public Map<String, Object> validateTokenAndGetClaims(final String token) {
        val profile = validateToken(token);

        final Map<String, Object> claims = new HashMap<>(profile.getAttributes());
        claims.put(JwtClaims.SUBJECT, profile.getId());

        return claims;
    }
Validates the token and returns the corresponding user profile.

@param token the JWT
@return the corresponding user profile
pac4j-jwt/src/main/java/org/pac4j/jwt/credentials/authenticator/JwtAuthenticator.java