use of org.wildfly.swarm.microprofile.jwtauth.deployment.principal.JWTCallerPrincipalFactory in project wildfly-swarm by wildfly-swarm.
the class TCKTokenParser method parse.
@Override
public JsonWebToken parse(String bearerToken, String issuer, PublicKey publicKey) throws Exception {
JWTAuthContextInfo authContextInfo = new JWTAuthContextInfo((RSAPublicKey) publicKey, issuer);
JWTCallerPrincipalFactory factory = DefaultJWTCallerPrincipalFactory.instance();
return factory.parse(bearerToken, authContextInfo);
}
use of org.wildfly.swarm.microprofile.jwtauth.deployment.principal.JWTCallerPrincipalFactory 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;
}
Aggregations