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

Automatically Prolong JWT Token #251

Open
okyksl opened this issue Nov 9, 2018 · 3 comments
Open

Automatically Prolong JWT Token #251

okyksl opened this issue Nov 9, 2018 · 3 comments

Comments

@okyksl
Copy link
Contributor

okyksl commented Nov 9, 2018

We have to automatically prolong JWT token whenever it is close to expiration time. Here is a related discussion I found on stackoverflow.

@srknzl
Copy link
Member

srknzl commented Nov 9, 2018

Yes I am reading it. And we can do this I think :

A good pattern is to refresh the token before it expires.

Set the token expiration to one week and refresh the token every time the user open the web application and every one hour. If a user doesn't open the application for more than a week, they will have to login again and this is acceptable web application UX.

To refresh the token your API needs a new endpoint that receives a valid, not expired JWT and returns the same signed JWT with the new expiration field. Then the web application will store the token somewhere.

@srknzl
Copy link
Member

srknzl commented Nov 10, 2018

This is done , close ?

@okyksl
Copy link
Contributor Author

okyksl commented Nov 10, 2018

Nope, it's not handled.

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

No branches or pull requests

3 participants