Search in sources :

Example 1 with MACVerifierExtended

use of com.topcom.cms.perm.token.verifier.MACVerifierExtended in project topcom-cloud by 545314690.

the class TokenManager method validateToken.

default boolean validateToken(String token) {
    if (token == null) {
        return false;
    }
    try {
        SignedJWT signed = SignedJWT.parse(token);
        JWSVerifier verifier = new MACVerifierExtended(getSharedKey(), signed.getJWTClaimsSet());
        return signed.verify(verifier);
    } catch (ParseException ex) {
        return false;
    } catch (JOSEException ex) {
        return false;
    }
}
Also used : MACVerifierExtended(com.topcom.cms.perm.token.verifier.MACVerifierExtended) SignedJWT(com.nimbusds.jwt.SignedJWT) ParseException(java.text.ParseException)

Aggregations

SignedJWT (com.nimbusds.jwt.SignedJWT)1 MACVerifierExtended (com.topcom.cms.perm.token.verifier.MACVerifierExtended)1 ParseException (java.text.ParseException)1