0

I am using vue-adal library in my VueJS application to connect to Azure AD.

AD Token valid for 1hr after login.

When my token expires i am unable to renew it from client side.

Is there any way to renew token from client side using VueJS or

Any other alternate approach can be used for this scenario?

Thanks, Gowtham

Gowtham
  • 635
  • 1
  • 7
  • 17
  • Hi Gowtham, may I know which OAuth flow did you use ? code grant or password credentials grant or any other flow ? – Hury Shen Jan 21 '20 at 02:18
  • Hi Hury, This is what i'm using, , "oauth2AllowIdTokenImplicitFlow": true, "oauth2AllowImplicitFlow": true, – Gowtham Jan 21 '20 at 05:26

1 Answers1

1

Since you are using implicit flow, azure AD will not return refresh token in implicit flow for you to refresh the token. As per this documentation, here is the recommended approach for this.

A JavaScript application has another mechanism at its disposal for renewing access tokens without repeatedly prompting the user for credentials. The application can use a hidden iframe to perform new token requests against the authorization endpoint of Azure AD: as long as the browser still has an active session (read: has a session cookie) against the Azure AD domain, the authentication request can successfully occur without any need for user interaction.