Google calendar integration Oauth token refresh

Humshain Ahmed
Tera Contributor

I have integrated my servicenow instance with google calendar in which i am getting the tokens as 
Access token with 1 hour expiry time 
Refresh token with 3 months of expiry time 
can someone please help me with the schedule script so that i can get the access token automatically after the initial request for the token

1 REPLY 1

mdmehedihas
Kilo Contributor

I think there no need to add scheduler, You can do it by normal flow. 
Let me explain,

Suppose someone want to use any google service which you integrated in your system,
so before call that API you can check the your access token is valid or not, If its invalid then you can fetch new access token by using Refresh token. For this you need to store the  access token, refresh token, and expired time in your DB table, 

I think if i'm not wrong its normal approch.