Oauth2 configuration to use Salesforce spoke

Alex153
Tera Contributor

Hi,

I am configuring oauth2 using Connection and credentials aliases in ServiceNow to authorize salesforce spoke. I use https://www.youtube.com/watch?v=vr1dpZSm1jA&pp=ygUbc2VydmljZW5vdyBzYWxlc2ZvcmNlIHNwb2tl

But I failed and get the error "URL No Longer Exists" when I am trying to Get OAuth Token 

Alex153_0-1695040669536.png

 

Why does it happen?

Watch this brief tutorial to learn how to set up your salesforce integration in ServiceNow.
1 ACCEPTED SOLUTION

msd93
Kilo Sage

Hi @Alex153 

 

This typically indicates a problem with the OAuth configuration or the URL being used for the token request. Try below troubleshooting steps:

1) Ensure that you have configured the OAuth provider correctly in ServiceNow. Make sure that the client ID, client secret, token URL, and other OAuth configuration details are accurate.

2) Double-check the token URL you are using in your OAuth request. It should be the correct URL provided by Salesforce for obtaining OAuth tokens. The URL should be in the format: https://<salesforce_instance_url>/services/oauth2/token.

3) Verify that there are no typos or syntax errors in the URL you are using. Pay special attention to any special characters or spaces that might be causing issues.

4) Try using tools like Postman or cURL to manually test the token request URL outside of ServiceNow. This can help you determine if the URL is valid and if Salesforce is responding to token requests.

5) Ensure that your Salesforce environment is correctly configured to allow OAuth access and that the connected app and OAuth settings in Salesforce are set up properly. Verify that the callback URL in Salesforce matches the one specified in your ServiceNow OAuth configuration. This you could check with the help of Salesforce Admin Support team.

6) Check if the OAuth token you are using (if any) has expired. OAuth tokens typically have a limited validity period, and if the token has expired, you will need to obtain a new one.

7) Check the ServiceNow instance logs for any errors or warnings related to the OAuth token request. This may provide insights into what specifically is causing the issue. 

8 ) In some cases, cached data in your browser or ServiceNow instance might cause issues. Try clearing the cache and cookies in your browser or consider clearing the cache in ServiceNow.

 

Hope this helps you.

View solution in original post

1 REPLY 1

msd93
Kilo Sage

Hi @Alex153 

 

This typically indicates a problem with the OAuth configuration or the URL being used for the token request. Try below troubleshooting steps:

1) Ensure that you have configured the OAuth provider correctly in ServiceNow. Make sure that the client ID, client secret, token URL, and other OAuth configuration details are accurate.

2) Double-check the token URL you are using in your OAuth request. It should be the correct URL provided by Salesforce for obtaining OAuth tokens. The URL should be in the format: https://<salesforce_instance_url>/services/oauth2/token.

3) Verify that there are no typos or syntax errors in the URL you are using. Pay special attention to any special characters or spaces that might be causing issues.

4) Try using tools like Postman or cURL to manually test the token request URL outside of ServiceNow. This can help you determine if the URL is valid and if Salesforce is responding to token requests.

5) Ensure that your Salesforce environment is correctly configured to allow OAuth access and that the connected app and OAuth settings in Salesforce are set up properly. Verify that the callback URL in Salesforce matches the one specified in your ServiceNow OAuth configuration. This you could check with the help of Salesforce Admin Support team.

6) Check if the OAuth token you are using (if any) has expired. OAuth tokens typically have a limited validity period, and if the token has expired, you will need to obtain a new one.

7) Check the ServiceNow instance logs for any errors or warnings related to the OAuth token request. This may provide insights into what specifically is causing the issue. 

8 ) In some cases, cached data in your browser or ServiceNow instance might cause issues. Try clearing the cache and cookies in your browser or consider clearing the cache in ServiceNow.

 

Hope this helps you.