Access and refresh tokens

miyu
Tera Guru

We manage the tokens used to connect to Google Calendar from ServiceNow.
As shown in the image below, it manages access and refresh tokens, with access tokens expiring in 30 minutes and refresh tokens expiring in 24855 days.

find_real_file.png
It is recognized that the access token will be regenerated by the refresh token when it expires, so there is no error.
However, the following error seems to occur due to the expiration of the access token.

ProcessingException: User Not Authenticated. Could not retrieve a new access token with the refresh token. invalid_grant, Token has been expired or revoked.


Why is this? Am I understanding this incorrectly?

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

was this working fine earlier?

which grant type are you using?

Regards
Ankur

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

Hi Ankur.
Thank you for your answer.
Yes, I am looking for a new product. It used to work well.
It still works fine, but after a few days of getting the token from the following screen, it stops working properly and the above error appears.


find_real_file.png

Grant type is Authorization Code.

find_real_file.png

Is there something wrong with my settings?

Logan Poynter
Mega Sage
Mega Sage

Hello miyu,

Are you able to manually perform a token refresh?

Also, please update your Token URL to https://www.googleapis.com/oauth2/v4/token as shown in the documentation for IntegrationHub with Google Calendar - yours being on v3 may be causing an unknown issue. Also, validate the remainder of your Application Registry settings. 

Lastly, if your company is entitled to IntegrationHub I would utilize the spoke for this integration as shown in the remainder of the documentation. 


Please mark my answer as correct/helpful if it has helped you.

Thanks,
Logan
--
LinkedIn

Hi Logan
Thank you for your reply.
As you answered, I changed the URL of the token from v3 to v4.
However, after changing to v4, the connection to Google Calendar is no longer possible.
Do I need to change any other settings?