-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
refresh_ttl config not considered when refreshing the token via RefreshToken middleware #63
Comments
Have same issue, for now I have done the test myself: The listener that intercepts the 'expired' token event
The filter
And any authenticated route
I still hate a problem anyway, when the token is refreshed the first time, it's possible that some other requests are pending asynchronously, so when the first one resolves and get back with the updated token, all the following raise a 500err because their token have been blacklisted... any ideas ? |
I have the same issue with asynchronous requests when using the refresh method. I'm also having problems with parsing the token to get a user. The refresh middleware runs before the controller runs, and I then use this within the controller:
This throws a blacklisted exception, presumably because the token just got blacklisted by the refresh middleware? I looked at the source, and it seems to want to wait 60 seconds (or minutes?) before enforcing a blacklist, but this doesn't appear to be happening in reality. This is all with the latest Laravel 5 |
Same problem here with laravel 4.2 |
@mmichaelbiz Thanks for highlighting this. It looks like I need to look at the refresh flow properly, and I guess I need to bulk out the token refreshing tests aswell. Apologies for the slow response, been mega busy lately. Thanks! 👍 |
No sweat. I have an angular service set up and listening out for any refreshed tokens so as soon as you get it sorted let me know to test it out! On another note, how do we handle cross device tokens? i.e. User logs in via their desktop browser and gets a JWT, then logs in via their mobile / tablet. Should be able to get a new token for the additional device without invalidating the first. |
+1 please, having similar issues with L5 and Angular front-end. Thank you, great project! |
+1 please, having similar issues with L5 |
As I see JWTManager::refresh() Should call setRefreshFlow() before decode to prevent "expire" validation. |
@mmichaelbiz Just pushed out don't have time to test it properly right now, but feel free to give it a go 👍 |
Awesome, thanks for the heads up. Will aim to give it a go this week! |
@tymondesigns, I took some time to test this out:
Would be nice to be able to add our own HTTP Status Codes, messages and possibly even Error Codes for the various exceptions. (i'll link this it #67) 👍 on the security fix by the way. I see you have blocked none algorithms completely. |
@mmichaelbiz Thank you for the feedback! I'm about to spin up a fresh install, so I will look into the issues you raised Thanks! 👍 |
@tymondesigns I have found similar re: @mmichaelbiz points 1 & 3. Thank you! 👍 |
This issue should be fixed in pull request #102 as @DangerLifter suspected, the setRefreshFlow wasn't set before the token was decoded. |
Closing as main issue resolved (as of |
…/readthedocs docs: setup Read the Docs
Hi Sean,
First off let me say this is a great package!
It seems that the RefreshToken middleware does not consider the 'refresh_ttl' but only the 'ttl' config.
For example set the config as (just for testing):
I get the new token on every response and use that for the next request which is fine.
But the token can only be used for 1 minute as per the ttl.
I don't want to have the user login again until after 5 mins (as per the refresh_ttl).
What do we need to do to have this work? Have I misunderstood the concept around the refresh_ttl and RefreshToken middleware?
The text was updated successfully, but these errors were encountered: