OAuth token not being auto-generated for Salesforce Intergration

Vishwa Pandya19
Mega Sage

Hello,

 

We have done Salesforce integration via Salesforce spoke.

We first connected to Salesforce Sandbox instance. We did not face any issues whatsoever. The OAuth was generating as expected. Whenever we ran a REST step it always worked, OAuth was always generated automatically.

 

Now we have connected to Salesforce Production Instance. 

The OAuth is not generating automatically even though the refresh token is available.

It expires after 30 mins and we get a 401 error.

 

Upon further investigation we found that when ServiceNow attempts the OAuth Generation it goes to Salesforce legacy URL (instancename.salesforce.com) instead of the new Salesforce URL (instancename.my.salesforce.com) which is why the connection is not established and OAuth is not generated.

 

This only happens during auto-generation of OAuth, if we manually get OAuth then it works fine.

 

We have checked everywhere in ServiceNow, the URLs for Salesforce are correctly mentioned. 

 

Can anyone guide me on this? What other debugging steps should we do because we are facing this issue and Hi Case agent insists there is nothing wrong in ServiceNow.

 

Regards,

Vishwa

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Vishwa Pandya19 

seems you need to ensure the correct URL is configured in connections, alias etc

Check the place in dev which are configured and that will give you an idea.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Already checked numerous time by myself as well as the Hi case agent.

We are referring to correct URL.

Still it goes to wrong URL for OAuth Regeneration.

@Vishwa Pandya19 

If ServiceNow is debugging let them debug and wait for the status

Do let us know what's the issue and what was the workaround.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader