2
我正在servlet上使用jjwt Java库进行jwt的服务器端生成,直接从jjwt GitHub页面https://github.com/jwtk/jjwt下面的代码snipper生成并打印出此令牌。使用Java生成的JJWT签名在jwt.io调试器上失败
eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJKb2UifQ.XIKER3owR8BS3Krhsksg9INh9VBSejdn_qN-ONtPans
String compactJws = Jwts.builder()
.setSubject("Joe")
.signWith(SignatureAlgorithm.HS256, "secret")
.compact();
PrintWriter out = response.getWriter();
out.println(compactJws);
然而,当我试图核实jwt.io的调试器这个令牌,失败签名检查。 Both checking and unchecking secret base64 encoded didn't work
我错误地使用库吗?