-
-
Notifications
You must be signed in to change notification settings - Fork 614
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
JWT cookies not working with custom encoder #1233
Comments
This contradicts with the bundle's design so I would not implement it in core. You would need to decorate JWTCookieProvider for your use case. You may also want to have a look at https://github.com/Spomky-Labs/lexik-jose-bridge instead of writing your own encryption. |
It's a shame. I understand what you're saying, but the idea is that I need to use my own encoder for security reasons, on top of the default one. In other words, there are two levels: the first level is that the token is encoded by |
Can you create a simple application with the minimal code that allows reproducing the issue and share the repository here? |
Hello, sorry for the delay. Here is the repository If you need anything else, feel free to reach out to me. Additionally, I have included the Postman collection in case you need it. Thank you in advance! |
Thank you! I'm taking a break for Christmas but I'll look into this asap. |
The issue is that when I create a custom encoder that takes the token generated by
encoder.lcobucci
and re-encrypts it, the cookies don't work, but the headers do. From what I've been able to verify, is because the cookies call aJWTSplitter
class, and since the new token is encrypted, it doesn't have the JWT format (header.payload.signature). What's curious is that the headers don't call this class, so the custom encoder canencode
anddecode
without any problems.Is there any way to create any cookie provider?
Can
JWTCookieProvider
class use the encoders before callingJWTSplitter
?I'm using the following configuration:
Custom encoder
The text was updated successfully, but these errors were encountered: