How to get new Refresh token when an old one expires

Madhan007
Tera Contributor

Hi Everyone,

In oauth_credential table, I see that 4  ServiceNow Request Refresh tokens are going to expire next month, but there are no access tokens with same name. when I checked Application Registry records, I found a OAuth Client Record with the same name with Redirect URL being  snempappauth://.

I am not aware of where this is being used and how to  authorize or refersh the token.

Madhan007_0-1767013806038.png

Madhan007_1-1767013949863.png
Any Insights into this are highly appreciated. Thanks in Advance!

 

1 REPLY 1

Ankur Bawiskar
Tera Patron
Tera Patron

@Madhan007 

it's always recommended to get access token and refresh token on every API call

with this you need not worry on the expiration of token

You can use script to obtain the refresh and access token from script

refer below links

OAuth2.0: Get new Access Token from existing Refresh Token

How to Setup OAuth2 authentication for outbound RESTMessageV2 integrations

OAuth : Script to Automate Token Request

How to generate the access token once it is expired from Business Rule?

How to get Auth Token using script when grant type is Authorization code

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader