The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Access Token Refresh Issue

MonalishaK
Tera Contributor

Hi All,

 

Can you help me with the below issue?

 

We are not able to get the access token using refresh token, after sometime access token is getting expired and the record is getting deleted  from oauth_credential table

 

Thanks and Regards,

Monalisha

 

2 REPLIES 2

Quinten
Tera Guru

Hi @MonalishaK 

 

The typical oauth fllow for this is is to first authenticate with client id, client secret, etc, you'll receive 2 types of tokens. One is the access token one is the refresh token. An access token lifespan is often only valid for 30 minutes up to an hour. The Oath script should validate the expiration date of the access token. If the access token is expired, a request is made using the refresh token to get a new access token.

Ankur Bawiskar
Tera Patron
Tera Patron

@MonalishaK 

if your refresh token is having longer expiration and that date has not yet reached then you should be able to generate fresh access token using refresh token.

If refresh token is expired then you need to make a fresh call with credentials to 3rd party to get the refresh token.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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