Skip to content
Permalink
Browse files Browse the repository at this point in the history
Use parseClaimsJws method instead of parseJws
  • Loading branch information
dogukan10 committed Jul 26, 2021
1 parent 12197a7 commit a59ad46
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -36,7 +36,7 @@ public Claims validateToken(String token) throws AuthenticationException {
RsaKeyUtil rsaKeyUtil = new RsaKeyUtil();
PublicKey publicKey = rsaKeyUtil.fromPemEncoded(keycloakPublicKey);

return Jwts.parser().setSigningKey(publicKey).parseJws(token.replace("Bearer ", "")).getBody();
return Jwts.parser().setSigningKey(publicKey).parseClaimsJws(token.replace("Bearer ", "")).getBody();
} catch (Exception e){
throw new AuthenticationException(String.format("Failed to check user authorization for token: %s", token), e);
}
Expand Down

0 comments on commit a59ad46

Please sign in to comment.