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 handle token refresh #9

Open
nivv opened this issue Jun 23, 2016 · 2 comments
Open

How to handle token refresh #9

nivv opened this issue Jun 23, 2016 · 2 comments

Comments

@nivv
Copy link

nivv commented Jun 23, 2016

It's my understanding that using the same token over and over opens up a window of attack, therefore the token should only be valid for a set amount of time.

It would be awesome if you could show an example of how to do that. Or am I overthinking things? Is it OK to have a token that expires after two weeks for example?

What are your thoughts?

@chenkie
Copy link
Contributor

chenkie commented Jun 24, 2016

I'd recommend against token refreshing for single page apps in general. The problem is that if an attacker ever gets a hold of the refresh token, they can effectively stay logged in forever, or at least until you change your secret key.

The JWTs that Auth0 issues are valid for 10 hours by default. This is a good amount of time in my view. Sure your users will need to sign in every day, but keeping the validity period narrow like this helps security.

@guillaumevincent
Copy link

@chenkie normally refresh token is allowed during 1 week. So attacker can't refresh token "forever".
And a token should be refreshed only if he is still valid.

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

3 participants