-
-
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 custom claims from the subject when a token is refreshed #1619
base: develop
Are you sure you want to change the base?
Refresh custom claims from the subject when a token is refreshed #1619
Conversation
This change breaks the refresh middleware flow as it requires the token not to be expired when refreshing. If you first call A further problem is that |
Hey @mattmcdonald-uk , thanks for your comment. |
I had to make a couple of changes to get this fix working for me. Adding a call to Adding a test on the call to |
I get an error when I try to implement this: {
"message": "Method [authenticate] does not exist.",
"exception": "BadMethodCallException",
"file": "[...]vendor/tymon/jwt-auth/src/JWT.php",
"line": 425,
[...] This is because the |
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
@mjsarfatti stuck on exactly this issue, how do I refresh the claims? Does anyone have it working, the above doesnt work. |
Fixes #891
Currently when you refresh a token, it does not regenerate the custom claims data. If for example data in my
getJWTCustomClaims
is dynamic the only way the token gets updated is with a new login.This change will recreate the claims array properly for refreshed tokens as well.
(Apologies if this is the wrong way to do it, happy to discuss other solutions)