0

I am using Azure AD to fetch access token. I am using Javascript and HTML to get user logged in and on successful login I got access token and expire time. Now I am looking forward to get the renewed access token on completion of expire time, I anybody can provide me a solution in javascript which uses the refresh token to fetch new access token.

1 Answers1

0

JavaScript apps executing in a browser don't rely on refresh tokens representing sessions. The session is maintained by the cookie that Azure AD issues upon successful authentication. Applications can leverage that session for renewing access tokens, typically by using a hidden iframe that requests tokens via implicit flow and no UX (enforced via prompt=none parameter). The Azure AD libraries for SPA apps (ADAL JS and MSAL JS) perform those renewal operations automatically for you, implementing the approach I described earlier. Please see https://azure.microsoft.com/en-us/resources/samples/?service=active-directory&term=javascript for a collection of samples demonstrating usage of those libraries.

vibronet
  • 7,364
  • 2
  • 19
  • 21