I am new to the Oauth protocol and have developed an identity server application that generates access_token
s for applications.
The lifespan of a token is currently set at 5 minutes. I'm storing the access_token
in a cookie when a user logs into my AngularJS JavaScript application, but sometimes the token expires before the session ends.
How can I automatically refresh the token? Should I consider sending a token request every 2 minutes or using another method?
Additionally, which grant type would be most suitable for this scenario?