is there autorefresh of the secure client token based on expiry
Opened this issue · 1 comments
alishah730 commented
while calling time series APIs how we will manage token expiry and refresh
swapnavad commented
Yes, it is possible to manage token expires and refresh. It is not implemented as a functionality on rest client. Following are the steps :
1.Check the token expiry ( call to check-token or using the Fast token utility)
- to check for token expires, decode the JWT token and check for iat and exp claim.
( https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-15#section-4.1.4 ) - iat claims is the time when the token was issued
- exp claim is the time when the token will expired.
check on the exp claim and current timestamp, will indicate the token expiry.
2.If the token is near or expired then invoke a call to UAA using the grant_type of refresh_token to fetch a refresh token.