Unable to fetch Oauth Token
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2024 03:25 AM
I am trying to 'Get Oauth token' after setting up an oauth registry in ServiceNow. I have provided all details like client id, client secret, etc. Getting erroe when trying to get token:
OAuth flow failed. Verify the configurations and try again. Error detail:failed to request a token.
Mid Server being used is up and running. Proxy is configured in mid server config.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2024 04:03 AM
A valid refresh token exists (for authorization code grant type), and the REST step contains a valid connection alias defined in the connection details section, everytime the flow gets triggered it will make servicenow look for an access token to successfully make a call, if it finds that the access token has expired it will auto-retrieve access token before making the REST call. But if the refresh token itself is expired then the first manual retrieval will again be needed. If the grant type is client credentials then after first manual retrieval of access token no need to further bother for the regeneration of access token again ever. Hence, for integrations configured via IntegrationHub flow designer there's no separate script required to fetch the tokens as opposed to the integrations configured via REST messages where a separate script shall be required to handle the auto generation of access tokens.
Refer below link:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0791131
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2024 04:15 AM
Hello Anand,
Thanks for your prompt help and guidance. I tried the scripts suggested in the KB article you shared but I received below response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2024 04:21 AM
What need to be passed in requestor_id? I passed the proid registered for authentication.