We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Noticed while working on the unencoded payloads and trying to re-create the scenarios in the RFC that the OCT JWK import is not working correctly.
It seems that the key import and export is missing the Base64 encoding parts.
This should work:
key = ::JWT::JWK.import({kty:"oct", k:"AyM1SysPpbyDfgZld3umj1qzKObwVMkoqQ-EstJQLr_T-1qS0gZH75aKtMN3Yj0iPS4hcgUuTwjAzZr1Z9CAow"}) token = ::JWT::EncodedToken.new("eyJhbGciOiJIUzI1NiJ9.JC4wMg.5mvfOroL-g7HyqJoozehmsaqmvTYGEq5jTI1gVvoEoQ") token.verify_signature!(algorithm: "HS256", key: key.verify_key) # => raises JWT::VerificationError
When explicitly decoded it works:
key = ::JWT::JWK.import({kty:"oct", k:Base64.urlsafe_decode64("AyM1SysPpbyDfgZld3umj1qzKObwVMkoqQ-EstJQLr_T-1qS0gZH75aKtMN3Yj0iPS4hcgUuTwjAzZr1Z9CAow")}) token = ::JWT::EncodedToken.new("eyJhbGciOiJIUzI1NiJ9.JC4wMg.5mvfOroL-g7HyqJoozehmsaqmvTYGEq5jTI1gVvoEoQ") token.verify_signature!(algorithm: "HS256", key: key.verify_key)
We need to fix this, but as it's breaking change in imports and exports it would be suitable for the 3.0 version.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Noticed while working on the unencoded payloads and trying to re-create the scenarios in the RFC that the OCT JWK import is not working correctly.
It seems that the key import and export is missing the Base64 encoding parts.
This should work:
When explicitly decoded it works:
We need to fix this, but as it's breaking change in imports and exports it would be suitable for the 3.0 version.
The text was updated successfully, but these errors were encountered: