You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
how to access the refresh token if my app idle for about half an hour without refreshing the page. #101
I have an app that validates token from backend. If my app idle for about an hour, the validation trigger for valid token.. Is there a way to get a refresh token without refreshing the page?
For anyone in this same situation, as @aamay001 mentioned there's an undocumented method adalGetToken(AuthenticationContext, resource) you can use to silently refresh the token. Given that the library doesn't refresh the token automatically, and needs to be manually handled.
However if the user is not logged in anymore or the token can't be refreshed, it will throw an error with a msg: 'login_required', in that case you need to either refresh the page or call the AuthenticationContext.login() to redirect the user to the login page.
Leaving this here for the next person 👍
Reacted by Andy Amaya, Samuli, yannickvidal, David Corbin and John
Activity
qt-pixels commentedon Mar 25, 2020
Bump!
jka1010 commentedon May 26, 2020
any updates on this issue ? pl share
saikumarkunchaa commentedon Jun 25, 2020
If you find any solution , please comment here @erwin-d-austria
aamay001 commentedon Aug 5, 2020
There's a method named
adalGetTokenin the library. You can call it to renew the token from anywhere. @jka1010 @saikumarkunchaa @qt-pixels @erwin-d-austriafoxxor commentedon Oct 22, 2020
For anyone in this same situation, as @aamay001 mentioned there's an undocumented method
adalGetToken(AuthenticationContext, resource)you can use to silently refresh the token. Given that the library doesn't refresh the token automatically, and needs to be manually handled.However if the user is not logged in anymore or the token can't be refreshed, it will throw an error with a
msg: 'login_required', in that case you need to either refresh the page or call theAuthenticationContext.login()to redirect the user to the login page.Leaving this here for the next person 👍