Replies: 2 comments 2 replies
-
What you could do (pre-
|
Beta Was this translation helpful? Give feedback.
0 replies
-
I think that using custom constraint to validate the signature might be an option. Imagine something like this: new VerifySignatureWithFallbackKey(
new SignedWith(new Hmac\Sha256(), 'new key'),
new SignedWith(new Hmac\UnsafeSha256(), 'old key'),
); Having that new constraint implementing the Having key sets and the key id on the token would be amazing, that would also require custom implementation on your end, though. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Thanks for the great library!
Just looking for someone to point me in the right direction here. In version 4.2.0 a minor BC break was released if you're using a key length of less than 256 bits. This alerted me that I'm actually using key lengths of 248 bits in production. I currently use this library to generate magic login tokens for my users.
If I just start using a new key, all the existing login links will be invalidated. Which is not something I want to do (since these particular users cannot generate themselves another link, they receive (relatively) short lived login links from other users).
Do you have a recommended way to rotate keys such that old login links still work correctly (at least for a short period of time)?
Beta Was this translation helpful? Give feedback.
All reactions