public UserProfile validateToken(final String token) {
        val credentials = new TokenCredentials(token);
        try {
            validate(new CallContext(null, null), credentials);
        } catch (final HttpAction e) {
            throw new TechnicalException(e);
        } catch (final CredentialsException e) {
            logger.warn("Failed to retrieve or validate credentials: {}", e.getMessage());
            logger.debug("Failed to retrieve or validate credentials", e);
            return null;
        }
        return credentials.getUserProfile();
    }
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