- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2024 02:20 PM
I have an instance which is sending HTTP requests to Microsoft Graph API, and I can see that for every outbound request, my ServiceNow instance sends a request to login.microsoftonline.com for an OAuth v2.0 token. This is resulting in hundreds of thousands of requests for tokens daily, and many of these requests are made at the exact same second. Is there a way in ServiceNow that I can re-use these OAuth 2.0 tokens and reduce the number of outbound calls being made to the associated token endpoint?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2024 04:34 PM
It's been a while since I've looked at OAuth, but I think the oauth_credential table stores the tokens until they expire. You could configure your HTTP request to first look up the relevant OAuth token there and, if it exists, use the token value. If the token doesn't exist, or it has expired, your HTTP request can first make a call to refresh the existing token or retrieve a new one.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2024 04:34 PM
It's been a while since I've looked at OAuth, but I think the oauth_credential table stores the tokens until they expire. You could configure your HTTP request to first look up the relevant OAuth token there and, if it exists, use the token value. If the token doesn't exist, or it has expired, your HTTP request can first make a call to refresh the existing token or retrieve a new one.