如何验证或验证JWT签名? [英] How to validate or verify JWT Signature?

查看:1534
本文介绍了如何验证或验证JWT签名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试用Java验证JWT令牌.如何验证或验证JWT令牌的JWT签名?

I am trying to validate JWT token in Java.How to validate or verify JWT Signature of JWT token?

推荐答案

您可以使用Spring Security的JWT库,网址为 https://github.com/spring-projects/spring-security-oauth http://mvnrepository.com/artifact/org.springframework.security/spring-security-jwt/1.0.1.RELEASE .

You can use JWT library from Spring Security available at https://github.com/spring-projects/spring-security-oauth and http://mvnrepository.com/artifact/org.springframework.security/spring-security-jwt/1.0.1.RELEASE.

org.springframework.security.jwt.JwtHelper类具有一个静态方法,该方法使您可以解析JWT令牌并验证其签名.

Class org.springframework.security.jwt.JwtHelper has a static method which allows you to parse the JWT token and verify its signature.

这篇关于如何验证或验证JWT签名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆