-
Notifications
You must be signed in to change notification settings - Fork 116
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
Provide AccessToken object to storeToken and removeToken methods #437
Comments
This is related to #298 as it would provide a better mechanism to implement it. |
Seems legit to me. I was going to suggest that you propose a PR, but I see you're already in progress with that. Submit it when done and I'll review it. |
One issue is that for It's only when the I'll submit a PR once I have it all working in my real application to make sure there aren't any other surprises. |
#521 will resolve this. |
This is complete in the 5.0.x branch. |
The storeToken and removeToken methods are not useful in many cases because you need access to the refreshToken (in both cases) and the principal (in the removeToken case).
The most common use case for these methods would be to implement some kind of stateful handling of the token (either a whitelist for active tokens or a blacklist of blocked tokens).
In both cases, you need to be able to handle both the accessToken and the refreshToken including access to other JWT attribute such as expiration, subject, etc. For instance, if you are trying to blacklist a token when the user explicitly logs out, you need to also blacklist the refreshToken since someone with access to the token could just use it to create a new accessToken.
My suggestion is to add additional method signatures:
To keep backwards compatibility, we can just have these call the other methods by default in the
JwtTokenStorageService
.The places that call store and remove will be changed to pass the AccessToken, allowing for more flexibility.
The text was updated successfully, but these errors were encountered: