Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to access the refresh token if my app idle for about half an hour without refreshing the page. #101

Open
erwin-d-austria opened this issue Jan 6, 2020 · 5 comments

Comments

@erwin-d-austria
Copy link

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?

@qt-pixels
Copy link

Bump!

@jka1010
Copy link

jka1010 commented May 26, 2020

any updates on this issue ? pl share

@saikumarkunchaa
Copy link

If you find any solution , please comment here @erwin-d-austria

@aamay001
Copy link

aamay001 commented Aug 5, 2020

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

@foxxor
Copy link

foxxor commented 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 the AuthenticationContext.login() to redirect the user to the login page.

Leaving this here for the next person 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants