<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content

Okta Workflows ServiceNow Connection Fails with 401 Unauthorized or Failed to Load Error

Workflows
Okta Classic Engine
Okta Identity Engine

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

 

ServiceNow 401 Unauthorized error message

 

Failed to Load

ServiceNow Failed to Load error on Action card

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.

  1. 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.
  2. In the HAR trace, find the POST request to the /test endpoint and get the Response:

TestEndpoint

 

  1. 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
    }
}
To verify the credentials are valid, use Postman or a similar tool to call one of the ServiceNow REST APIs outside of workflows to confirm successful authentication.
 
  1. 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": []
            }
      }
    }
}
This error can occur when the account does not have the incident_manager role in ServiceNow.  Verify the account has all of the permissions required by the connector as documented in the ServiceNow Authorization documentation.
 

 

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.

  1. 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).
  2. Check with the ServiceNow team and ensure that the Service Account used has the personalize_dictionary and incident_manager permissions in ServiceNow.

Related References

Loading
Okta Workflows ServiceNow Connection Fails with 401 Unauthorized or Failed to Load Error | Okta Support