<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
System Status
Announcements
Announcements
Search
Search
Select Language

Okta Salesforce Provisioning Fails With an Authorization Failed Error

Okta Classic Engine
Okta Identity Engine
Okta Integration Network

Overview

Okta fails to create a new user in Salesforce due to expired refresh tokens, mismatched Connected App policies, or incorrect credentials. Configuring the Salesforce API OAuth 2.0 settings correctly resolves this issue. Okta generates the following error during user provisioning, which displays the authorization failure details in the administrator dashboard. Review the authorization failure error message in the following image.

 

Push new user to external application FAILURE: "Authorization failed, unable to retrieve Access Token for salesforce".

 

Salesforce authorization failure error message

Applies To

  • Okta Identity Engine (OIE)
  • Okta Classic Engine
  • Salesforce

Cause

Expired or revoked refresh tokens, mismatched Connected App policies, or incorrect credentials typically cause an authorization failure or inability to retrieve an Access Token for Salesforce.

Solution

What are the correct Salesforce API OAuth settings?

Configure the Salesforce API OAuth 2.0 settings by verifying the OAuth scopes and enabling the required security options in the Salesforce administrator console.

  1. Verify the OAuth Scopes include Manage user data via APIs (api) and Perform requests at any time (refresh_token, offline_access).
  2. Navigate to the Security section.
  3. Select Require secret for Web Server Flow.
  4. Select Require secret for Refresh Token Flow.
  5. Select Require Proof Key for Code Exchange (PKCE) extension for Supported Authorization Flows.
  6. Select Enable Refresh Token Rotation.

Review the configured Salesforce OAuth scopes and security settings in the following image.

Salesforce OAuth scopes and security settings

 

The Salesforce Integration Requires Re-Authentication in the Okta Admin Console

Copy the Salesforce Consumer Key and Secret into the Okta Provisioning Integration settings and re-authenticate the connection.

Okta Provisioning Integration settings

Review the Okta Provisioning Integration settings in the following image.

  1. Enter the Salesforce consumer key in the OAuth Consumer Key field.
  2. Enter the Salesforce consumer secret in the OAuth Consumer Secret field.
  3. Select the PKCE Enabled checkbox.
  4. Click Re-authenticate with Salesforce.com.
  5. Click Save.

Review the successful authentication confirmation in the following image.

Successful authentication confirmation

 

Related References

Loading
Okta Salesforce Provisioning Fails With an Authorization Failed Error | Okta Support