react-adal
react-adal copied to clipboard
how to access the refresh token if my app idle for about half an hour without refreshing the page.
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?
Bump!
any updates on this issue ? pl share
If you find any solution , please comment here @erwin-d-austria
There's a method named adalGetToken
in the library. You can call it to renew the token from anywhere. @jka1010 @saikumarkunchaa @qt-pixels @erwin-d-austria
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 👍