This article provides information on how to troubleshoot the following error that occurs when attempting to utilize Okta API PUT request with the Microsoft O365 application:
"errorCode": "E0000037",
"errorSummary": "Type mismatch exception. ",
"errorLink": "E0000037",
"errorId": "ErrorIDaaa111bbb222",
"errorCauses": []
- Okta API
- Microsoft O365
Usually, a GET command is performed to gather the body details for their Microsoft O365 application within their Okta organization. Within the body details, there are some query parameters that need to be changed and/or deleted to allow for a successful PUT request. The details are different depending on which Okta Org version is currently being utilized (Classic or Okta Identity Engine).
NOTE: This error is encountered when utilizing a PUT request on an AUTO-federated Microsoft O365 domain.
First of all, there is No need to pass admin credentials.
In an Okta Identity Engine (OIE) organization, the "domains" query parameter under settings must be deleted.
Below is an example of how the body below the "settings" query parameter looks when performing a GET request on the Microsoft O365 application in Okta.
},
"settings": {
"app": {
"tenantType": null,
"wsFedConfigureType": "AUTO",
"occSettings": null,
"windowsTransportEnabled": false,
"domain": "exampleDomain.com",
"msftTenant": "exampleDomain.onmicrosoft.com",
"domains": [
"ExampleDomain.com"
],
"requireAdminConsent": true
},
The following must be removed:
"domains": [
"exampleDomain.com"
],
Then replace with "domainsString": "exampleDomain.com", (regardless if the org is classic or OIE).
* If there are multiple domains, use comma to separate : "domainsString": "exampleDomain1.com, "exampleDomain2.com"
},
"settings": {
"app": {
"tenantType": null,
"wsFedConfigureType": "AUTO",
"occSettings": null,
"windowsTransportEnabled": false,
"domain": "exampleDomain.com",
"msftTenant": "exampleDomain.onmicrosoft.com",
"domainsString": "exampleDomain.com",
"requireAdminConsent": true
},
If the userNameTemplate is using "template": "${source.login}", replace "template": "${source.login}" with "template": "user.login", (regardless if the org is classic or OIE)
Here is an example of the body and how this should look:
},
"features": [],
"signOnMode": "SAML_1_1",
"credentials": {
"userNameTemplate": {
"template": "user.login",
"type": "BUILT_IN"
},
Optional:
If this still doesn’t work, add all 3 parameters ("adminUsername", "adminPassword" and "domainsString"):
Those parameters are as follows:
- "adminUsername" (The string added should be the onmicrosoft user that was utilized to federate the Microsoft O365 domain with Okta.)
- "adminPassword" (The string added should be the password to the onmicrosoft account being used.)
- "domainsString" (The string should be the Microsoft O365 domain that was federated with Okta.)
Here is an example of the body and how this should look.
},
"settings": {
"app": {
"tenantType": null,
"wsFedConfigureType": "AUTO",
"occSettings": null,
"windowsTransportEnabled": false,
"domain": "exampleDomain.com",
"msftTenant": "exampleDomain.onmicrosoft.com",
"adminUsername": "exampleuser@exampleDomain.onmicrosoft.com",
"adminPassword": "onmicrosoftAdminPassword",
"domainsString": "exampleDomain.com",
"requireAdminConsent": true
},
NOTE: It is very important that all commas, brackets, and quotes are added correctly, or there will be additional errors.
