The CreatorCon Call for Content is officially open! Get started here.

Unable to fetch Oauth Token

aragarw
Tera Contributor

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.

7 REPLIES 7


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


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.

aragarw_0-1729768523152.png

 

aragarw
Tera Contributor

What need to be passed in requestor_id? I passed the proid registered for authentication.