Search code examples
angularjsasp.net-web-apiasp.net-identitytokenowin

In a asp.net web api + angular, with refresh tokens... how do I automatically request a token before it expires


I started using this tutorial to create a application sample, that uses refresh tokens. But in the application, the user have to click in a button to access the token and refresh it with a new token. I wish my application automatically request a new refresh token before it expires. How I can do this?


Solution

  • You should typically keep track of the time the token will expire and then request the new token before the expiration occurs. Requesting early in OAuth2.0 is acceptable.