Search in sources :

Example 1 with JWTCallerPrincipal

use of org.wildfly.swarm.microprofile.jwtauth.deployment.principal.JWTCallerPrincipal in project wildfly-swarm by wildfly-swarm.

the class JWTLoginModule method validate.

/**
 * Validate the bearer token passed in with the authorization header
 *
 * @param jwtCredential - the input bearer token
 * @return return the validated JWTCallerPrincipal
 * @throws ParseException - thrown on token parse or validation failure
 */
protected JWTCallerPrincipal validate(JWTCredential jwtCredential) throws ParseException {
    JWTCallerPrincipalFactory factory = JWTCallerPrincipalFactory.instance();
    JWTCallerPrincipal callerPrincipal = factory.parse(jwtCredential.getBearerToken(), jwtCredential.getAuthContextInfo());
    return callerPrincipal;
}
Also used : JWTCallerPrincipalFactory(org.wildfly.swarm.microprofile.jwtauth.deployment.principal.JWTCallerPrincipalFactory) JWTCallerPrincipal(org.wildfly.swarm.microprofile.jwtauth.deployment.principal.JWTCallerPrincipal)

Aggregations

JWTCallerPrincipal (org.wildfly.swarm.microprofile.jwtauth.deployment.principal.JWTCallerPrincipal)1 JWTCallerPrincipalFactory (org.wildfly.swarm.microprofile.jwtauth.deployment.principal.JWTCallerPrincipalFactory)1