I'm trying to make a node script verify a JWT token. I have the public key (it's a x.509 certificate) and the JWT.
I tried using https://github.com/auth0/node-jsonwebtoken but unfortunately it seems that they don't support x.509.
If you know of a package that verifies JWT tokens with x.509 certs I would appreciate it.
Thanks!
JWT can be signed with public/private keys. The method you are looking for is this one: https://github.com/auth0/node-jsonwebtoken#jwtverifytoken-secretorpublickey-options-callback
This tests show examples of how to use it:
https://github.com/auth0/node-jsonwebtoken/blob/master/test/jwt.rs.tests.js
You can also use http://jwt.io
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With