Open dcore099 opened 3 years ago
It seems like it needs more dependencies,
`
<artifactId>jjwt-api</artifactId>
<version>0.11.2</version>
Creates a key like this
`import io.jsonwebtoken.Jwts; import io.jsonwebtoken.SignatureAlgorithm; import io.jsonwebtoken.security.Keys; import java.security.Key;
// We need a signing key, so we'll create one just for this example. Usually // the key would be read from your application configuration instead. Key key = Keys.secretKeyFor(SignatureAlgorithm.HS256);
String jws = Jwts.builder().setSubject("Joe").signWith(key).compact();`
And i think it verifies it like this
assert Jwts.parserBuilder().setSigningKey(key).build().parseClaimsJws(jws).getBody().getSubject().equals("Joe");
Check out this used dependency, is it good and still widely used? Or just for study purposes?
`