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

Support JWKS url and validation using kid #119

Closed
joel-dubiner-wgu opened this issue Feb 4, 2021 · 3 comments
Closed

Support JWKS url and validation using kid #119

joel-dubiner-wgu opened this issue Feb 4, 2021 · 3 comments

Comments

@joel-dubiner-wgu
Copy link

Summary

Feature Request: Allow the user to specify the URL for the JWKS and use that for validation of the token

@Delapouite
Copy link

Currently, the jwt program has only 2 commands: encode and decode

Joel, do you mean that we should try to implement a third command, validate ?

It could do basic checking on date claims, like nbf or exp. And also, as you ask, more involved checks if it knows how to retrieve a JWK from a set

@erhhung
Copy link

erhhung commented May 27, 2021

I think the OP would like to run something like:

# jwt decode ... [--secret|--jwks]

jwt decode "$token" --jwks "$jwks"

where $jwks could be a full URL like https://example.com/jwks.json or (my idea) the JWKS JSON string itself.
The signature validation would depend on finding the right JWK by matching the kid in the header.

Doing HTTP requests has its own complexities, like potentially having to deal with proxies, etc.
Since this is already a CLI app, having the --jwks value be the JWKS JSON string itself would adhere more to the "Unix philosophy" where another CLI app, like curl, would fetch the actual JWKS:

jwt decode "$token" --jwks "$(curl https://example.com/jwks.json)"

@mike-engel
Copy link
Owner

Closing in favor of #129

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

4 participants