- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 01:41 AM - edited 01-03-2024 02:09 AM
If the grant type is client credentials:
How does Servicenow manage to generate a new access token once the first access token that was manually generated got expired ? Does it automatically regenerate subsequent access tokens or is a script required to generate subsequent access tokens ?
If the grant type is auth code/ Resource Owner Credentials:
1. Does servicenow auto generates new access tokens after they get expired based on the valid refresh token ?
2. Do the refresh tokens need to be manually re-generated once it gets expired after a default 864000 seconds or it is auto-generated in Servicenow ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2024 02:07 AM
Hi @Sandhya V , I tried implementing an integration via flow designer and what I observed was if at all 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 02:17 AM
if you are using REST messages and link these REST messages with the respective OAuth profile, ServiceNow will do everything for you in the background. That means, in case the access token is expired but the refresh token is not, a new access token is requested from the partner system automatically.
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 02:22 AM
Hi @Maik Skoddow,
What if the integration is configured through a flow designer (integration Hub) will Servicenow still auto fetch access tokens ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2024 10:49 AM
I am looking into this now as I built the integration in Flow designer and it is not refreshing the access token all the time. I have a valid refresh token right now, but no access token and the flow fails.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2024 02:09 AM
Make sure you have a connection alias added in the connection details sections of the REST step and are not using a connection inline option