-
Notifications
You must be signed in to change notification settings - Fork 24
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
Support for JWKS? #24
Comments
It's outlined in the readme: https://github.com/crystal-community/jwt#usage |
So the issue is that i dont see how we can assemble the |
I believe the request is to support verifying a JWT token via the JWKS method. i.e.: jwt_token = "aaaa.bbbb.cccc"
info = JSON.parse(Halite.get("https://oauth.com/.well-known/openid-configuration").body)
keys = JSON.parse(Halite.get(info["jwks_uri"].as_s).body)
payload, header = JWT.decode(jwt_token, keys, verify: true, validate: true) More links on the JWKS auth data: https://8gwifi.org/jwkconvertfunctions.jsp |
@kalinon if I'm reading this correctly there is a desire to have a helper class that can construct and decode the JWKS structure into something a little more useful? plus, potentially a HTTP wrapper to help with making requests using those keys? |
Perhaps the HTTP wrapper may be out of scope on this request, at a minimum i think we need to be able to pass a JWKS object to I admit i am not an expert in libcrypto or openssl, but it seems being able to set the The general workflow of JWKS for RS256 is:
Number 2 is not currently possible via the |
Here is the RFC: https://tools.ietf.org/html/rfc7517 |
Any chance of this being added? It will help usecases like integrating google/apple sign ins into our apps or using AWS services using the authenticated api. For eg. pp! pub_key_jwk = HTTP::Client.get "https://www.googleapis.com/oauth2/v3/certs" |
So after some headache, I have a very simple and reductive JWK to JWT which uses use mod and exp.
This only uses
out of all possible jwk fields
|
I made a lib for this here: https://github.com/place-labs/jwks I also wouldn't mind merging this into this repo. |
How would you verify and read a JWT signed by a JWKS? Here are some reference libs from other languages:
https://github.com/auth0/node-jwks-rsa
https://github.com/nov/json-jwt/wiki#decode--verify
The text was updated successfully, but these errors were encountered: