OAuth Token Expiring Every Hour – Not Refreshing Automatically in ServiceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago - last edited 2 hours ago
Hi team,
I have an integration set up between Microsoft 365 and ServiceNow where I created an Application Registry using client credentials.
Currently, I need to manually click the “Get OAuth Token” related link to generate the token. The token expires after about 1 hour, and once it expires the integration fails until I manually generate a new token again.
From my understanding, the token refresh should normally be handled automatically by ServiceNow.
Has anyone faced a similar issue where the OAuth token is not being refreshed automatically?
Is there any additional configuration required in the Application Registry or OAuth profile to enable automatic token refresh?
Any guidance would be appreciated.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi @dd31
Same thing we have faced. When we talked to Microsoft team 365 team , they said it is as per their policy and they will not change.
So you need to decide whether you will continue with 1 hour interval token generation as platform performance wise it is not good.
But as we do not have any other workaround for our use cases, we have continued with this 1 hour interval token generation.
Hope it answers your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Thanks for the response. However, generating the token every hour manually is not a feasible approach for our use case.
We have SAM jobs running in ServiceNow that depend on this integration with Microsoft 365, and these jobs use the OAuth token to fetch usage data. If the token expires every hour and requires manual regeneration, it would require constant intervention, which is not practical.
Ideally, the token generation or refresh should be handled automatically so that the scheduled SAM jobs can run without any manual steps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
56m ago - last edited 44m ago
Hi @dd31
Just sharing my exp if it helps.
Our use cases on SAM :using Direct integration profile we are pulling the data from O365 . Its kind of 180K+ data job runs at backend for 4 hours.
Among that count , 10 k data SAM team was not able to reconcile due toa specific reason.. so using this Oauth 2.0 set up we are sending the request via flow . Considering the data amt , we thought 1 hour is fine.
Same approach you can follow.
