Open neocolmartin opened 7 years ago
Someone elsewhere pointed me to the jwks-rsa
package that provides a way to look up JWK keys for express-jwt
: https://github.com/auth0/node-jwks-rsa/tree/master/examples/express-demo
After 2 years, this solution works excellent for me. Thanks @neocolmartin 👏 . Don't know why is so complicated to just use express-jwt by his own.
4 years later, still helpful. It may be useful to add the link/ example to docs on this repo
The README describes how to validate a JWT against a secret or a public key. However, when I try to do the same but using a JWK JSON object for an RSA key, I get an error.
Pull request #75 suggests that JWK keys are supported, but I can't get it to work.
This is my code:
Running the code above, and sending in a request with an
Authorization: Bearer
header containing a valid JWT, I get this error:If I uncomment the algorithms key (and restart node) and send the request again, I then get this error:
If I try
JSON.stringify(key)
instead, I get this error:Are JWK keys supported? If so, how do I use them for validation?