I am trying to decode and verify JWT token in my service using the following code:
String jwtSecret= "my_key";
Claims claims = Jwts.parser()
.setSigningKey(jwtSecret)
.parseClaimsJws(jwt).getBody();
return claims;
The above code does not work and throws the following exception:
java.lang.IllegalArgumentException: Key bytes cannot be specified for RSA signatures. Please specify a PublicKey or PrivateKey instance.
I have tried creating Public key also but it didn't work. Can anyone state what I am missing?