Generating the access token with grant type as refresh_token
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 05:34 AM
Hi All,
Want to know, how can I generate the access token from ServiceNow with grant type as refresh_token.
This is for outbound REST call from ServiceNow to external APIs. Want to generate the access token using client id/secret and refresh token. And use that access token to make subsequent REST call.
This has example https://www.oauth.com/oauth2-servers/access-tokens/refreshing-access-tokens/

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 05:54 AM
Hello @Mr A
You need to POST to below mentioned URL to get new access token using refresh token
Note: replace values in CAPS with actual values
Thanks,
Ali
Thank you,
Ali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 06:09 AM
Thanks for your reply, this can be used when any external application want to get the token from servicenow instance.
Is there any option from ServiceNow, If I can make to other client to get the access token using any of the existing mechanism (if this can be done without any custom script, great. else happy for any custom options), and store in oauth credentials form so that can use in subsequent REST calls.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 08:32 AM
If you are connecting to other application from ServiceNow, you can simply configure the OAuth details in "Application Registry" under "System OAuth" application.
for details: https://docs.servicenow.com/bundle/utah-api-reference/page/administer/security/task/t_UseAThirdParty...
Once you configure the Application registry, ServiceNow by default manages access token as well we refresh tokens.
Here is one YouTube video explaining the same: https://www.youtube.com/watch?v=QRjjZ911bZE
Thank you,
Ali