Skip to content
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

undefined method `verify' for nil:NilClass when validate a JWT with JWK #383

Closed
danielweil opened this issue Nov 12, 2020 · 3 comments
Closed

Comments

@danielweil
Copy link

I am trying to validate my JWT token using jwk, the same way it is present in the documentation, but I keep receiving the error:

"undefined method `verify' for nil:NilClass"

Can someone help me?
I get my jwk from my keycloak server, and it is a hash, with the right format.

image

image

Thanks!

@anakinj
Copy link
Member

anakinj commented Nov 14, 2020

Looks like you are using version 1.5.6 of the gem. The JWK support was introduced in 2.2.0.

@anakinj
Copy link
Member

anakinj commented Nov 14, 2020

Also the latest released version expect the keys to be symbols. The next release will have support for a mix of strings and symbols. Until that you need to symbolize the keys in the hash given to the decode method.

@anakinj
Copy link
Member

anakinj commented Dec 2, 2020

Closing this. Please reopen if there are some issues with this and the latest versions of the GEM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants