I create a JWT token and if I go to the official site https://jwt.io/ and check its validity, then it shows that it is not valid.
Please tell me why it turns out that it is not valid?
eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJKYWNrIiwiaWF0IjoxNjYwMDY3NjQ0LCJleHAiOjE2NjAxNTQwNDR9.yUqKI1t2xKVlhALUw12ie3DcpnGyXelcd7J-0qJ1FPg
public class GeneratorJwt {
public static void main(String[] args) {
Map<String, Object> claims = new HashMap<>();
SecretKey key = Keys.secretKeyFor(SignatureAlgorithm.HS256);
String jwtTokenKey = Encoders.BASE64.encode(key.getEncoded());
String s = Jwts.builder()
.setClaims(claims)
.setSubject("Jack")
.setIssuedAt(new Date(System.currentTimeMillis()))
.setExpiration(new Date((new Date()).getTime() + 86400000))
.signWith(SignatureAlgorithm.HS256, jwtTokenKey).compact();
System.out.println(s);
}
}