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
TypeError: no implicit conversion of OpenSSL::PKey::RSA into String #259
Comments
Thanks for reporting. What version of this gem are you using? |
You are specifying a HMAC algo but then trying to sign it with a RSA key which is causing the issue |
It works if I provide RSA key as string in PEM format:
|
@excpt will throwing JWT::EncodeError if hmac secret is not a String be okay in this case ? @yivo the HMAC secret is a single key that encodes and decodes. RSA uses a public/ private key. the #to_pem call returns a string so it will work as a key for HMAC. In this case the HMAC key has to be a string like in the docs |
Steps to reproduce:
JWT.encode({}, OpenSSL::PKey::RSA.generate(2048), 'HS384')
The text was updated successfully, but these errors were encountered: