jwt解析token报错:Signed Claims JWSs are not supported.
Exception in thread "main" io.jsonwebtoken.UnsupportedJwtException: Signed Claims JWSs are not supported.
at io.jsonwebtoken.JwtHandlerAdapter.onClaimsJws(JwtHandlerAdapter.java:50)
at io.jsonwebtoken.impl.DefaultJwtParser.parse(DefaultJwtParser.java:487)
at io.jsonwebtoken.impl.DefaultJwtParser.parseClaimsJwt(DefaultJwtParser.java:514)
at com.wfd.study.springboot.security2.JwtTest.main(JwtTest.java:28)
错误原因:parseClaimsJwt() 方法是解析没有进行签名的token,如果我们的token是已经进行了签名,调用了该方法,就会报出上述错误。
解决方法:签名的token应该使用parseClaimsJws(String jws) 方法