use of fish.payara.microprofile.jwtauth.jwt.JsonWebTokenImpl in project Payara by payara.
the class SignedJWTIdentityStore method validate.
public CredentialValidationResult validate(SignedJWTCredential signedJWTCredential) {
try {
JsonWebTokenImpl jsonWebToken = jwtTokenParser.parse(signedJWTCredential.getSignedJWT(), acceptedIssuer, readPublicKey("/publicKey.pem"));
List<String> groups = new ArrayList<String>(jsonWebToken.getClaim("groups"));
return new CredentialValidationResult(jsonWebToken, new HashSet<>(groups));
} catch (Exception e) {
logger.log(FINEST, "Exception trying to parse JWT token.", e);
}
return INVALID_RESULT;
}
Aggregations