Okta Workflows ServiceNow Connection Fails with 401 Unauthorized or Failed to Load Error
Last Updated:
Overview
A 401 Unauthorized or Failed to Load error occurs when creating or reauthorizing a ServiceNow connection in Okta Workflows due to invalid credentials or insufficient permissions. Resolve this issue by verifying the credentials and ensuring the service account has the required roles.
The following errors occur when attempting to create or reauthorize a ServiceNow connection in Okta Workflows or when loading an Action card:
401 Unauthorized
Failed to Load
Applies To
- Okta Identity Engine (OIE)
- Okta Classic Engine
- Okta Workflows
- ServiceNow Connector
Cause
For the 401 Unauthorized Error when creating the connection for Service Now:
- The ServiceNow connector uses Basic authentication, which requires a username, password, and instance name to create a connection. When attempting to create or reauthorize a connection and failing with the 401 Unauthorized error, it is commonly due to invalid credentials (an invalid username or password) or the account not having the ServiceNow permissions required by the connector.
For the Failed to Load Error on Action cards:
- If the connection does not have the permissions required to retrieve the type of values the dynamic drop-down is attempting to acquire, it will nearly immediately say Failed to Load. Please check with the ServiceNow team and ensure that the Service Account you used has the personalize_dictionary and incident_manager permissions in ServiceNow.
Solution
How to troubleshoot the 401 Unauthorized Error?
Generate a HTTP Archive (HAR) trace, locate the test endpoint response, and verify the credentials using an API testing tool by following these steps.
- Generate a HAR trace of the failure attempting to authorize the connection. See Generate HAR Files for detailed steps on how to generate a HAR file.
- In the HAR trace, find the POST request to the /test endpoint and get the Response:
- If the response body is 401 Unauthorized, the error is most likely due to invalid credentials:
{
"output": {
"serviceResponse": {
"statusCode": 401,
"body": "401 Unauthorized"
},
"working": false
}
}
- If the response body is "{ "result" : [] }", the error is most likely due to the account not having the permissions required by the ServiceNow connector:
{
"output": {
"working": false,
"serviceResponse": {
"statusCode": 401,
"body": {
"result": []
}
}
}
}
The Failed to Load error on Action cards is resolved by adjusting permissions.
Review and adjust the permissions for the ServiceNow account used in the service connection by following these steps.
- Ensure that the ServiceNow account has all necessary permissions to access the tables and fields required by the specific cards being used (such as Create Request, Create Incident, and Search Groups).
- Check with the ServiceNow team and ensure that the Service Account used has the personalize_dictionary and incident_manager permissions in ServiceNow.
