OAuth token not being auto-generated for Salesforce Intergration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2025 11:15 PM - edited 02-03-2025 11:17 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2025 11:30 PM
Hi @Vishwa Pandya19 ,
Please refer to the following threads:
https://unito.io/blog/servicenow-salesforce-integration/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2025 11:54 PM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2025 02:54 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2025 02:55 AM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader