Symptoms
When configuring the Salesforce Connection Manager with the OAuth 2.0 Client Credentials (Non-Interactive) authentication method, you may notice one of the following behaviors:
- Generate Token fails or returns an authentication error.
- Test Connection fails even though the Connected App appears to be configured correctly.
- OAuth authentication fails despite using a valid Client ID, Client Secret, and the Client Credentials flow being enabled.
Cause
A common cause of this issue is using the Lightning Experience URL as the OAuth Token URL.
For example, the following URL is incorrect :
https://yourcompany.lightning.force.com/services/oauth2/token
The OAuth token endpoint must use your Salesforce My Domain URL instead.
Solution
Update the Token URL in the Salesforce Connection Manager to use your Salesforce My Domain endpoint.
Correct format:
https://yourcompany.my.salesforce.com/services/oauth2/token
Replace
yourcompanywith your Salesforce My Domain name.
After updating the Token URL:
- Save the connection.
- Click Test Connection .
The authentication should now complete successfully.
How to Find Your Salesforce My Domain
If you are unsure of your My Domain:
- Sign in to Salesforce.
- Go to Setup .
- Search for My Domain in the Quick Find box.
- Copy the domain shown, for example:
https://yourcompany.my.salesforce.com
Use this domain when constructing the OAuth Token URL.
Additional Checks
If the issue persists, verify the following:
- The OAuth 2.0 Client Credentials Flow is enabled in the Salesforce Connected App.
- A Run As User has been configured for the Connected App.
- The Client ID and Client Secret are correct.
- The connected user has sufficient permissions to access the required Salesforce APIs.
- The OAuth scope includes the required api scope.
Example
Incorrect
https://zappysys.lightning.force.com/services/oauth2/token
Correct
https://zappysys.my.salesforce.com/services/oauth2/token
Conclusion
When using Salesforce OAuth Client Credentials authentication, always use your Salesforce My Domain (*.my.salesforce.com ) for the Token URL instead of the Lightning Experience (*.lightning.force.com ) URL. Although both domains may open the Salesforce UI, only the My Domain endpoint supports the OAuth token endpoint required for authentication.