Y. *_*imi 5 javascript json node.js jwt
我正在尝试让节点脚本验证 JWT 令牌。我有公钥(它是一个 x.509 证书)和 JWT。
我尝试使用 https://github.com/auth0/node-jsonwebtoken 但不幸的是,它们似乎不支持 x.509。
如果您知道使用 x.509 证书验证 JWT 令牌的软件包,我将不胜感激。
谢谢!
JWT 可以使用公钥/私钥进行签名。您正在寻找的方法是这个:https : //github.com/auth0/node-jsonwebtoken#jwtverifytoken-secretorpublickey-options-callback
此测试显示了如何使用它的示例:
https://github.com/auth0/node-jsonwebtoken/blob/master/test/jwt.rs.tests.js
您也可以使用http://jwt.io