88 log.debug(
"Verifying access_token");
89 if (
log.isTraceEnabled()) {
92 String wireString = jwsInput.getWireString();
93 log.tracef(
"\taccess_token: %s", wireString.substring(0, wireString.lastIndexOf(
".")) +
".signature");
94 }
catch (JWSInputException e) {
100 }
catch (VerificationException e) {
101 log.error(
"Failed to verify token", e);
103 return AuthOutcome.FAILED;
106 log.error(
"Stale token");
108 return AuthOutcome.FAILED;
110 boolean verifyCaller =
false;
119 log.warn(
"No trusted certificates in token");
121 return AuthOutcome.FAILED;
126 X509Certificate[] chain =
new X509Certificate[0];
128 chain = exchange.getCertificateChain();
129 }
catch (Exception ignore) {
132 if (chain == null || chain.length == 0) {
133 log.warn(
"No certificates provided by undertow to verify the caller");
135 return AuthOutcome.FAILED;
137 surrogate = chain[0].getSubjectDN().getName();
139 log.debug(
"successful authorized");
140 return AuthOutcome.AUTHENTICATED;
AuthChallenge challengeResponse(HttpFacade facade, final OIDCAuthenticationError.Reason reason, final String error, final String description)
Definition: BearerTokenRequestAuthenticator.java:159
AuthChallenge clientCertChallenge()
Definition: BearerTokenRequestAuthenticator.java:143
String getResourceName()
Definition: KeycloakDeployment.java:107
AuthChallenge challenge
Definition: BearerTokenRequestAuthenticator.java:41
String tokenString
Definition: BearerTokenRequestAuthenticator.java:38
KeycloakDeployment deployment
Definition: BearerTokenRequestAuthenticator.java:42
Set< String > getTrustedCertificates()
Definition: AccessToken.java:237
boolean isVerifyCaller()
Definition: AccessToken.java:153
AccessToken token
Definition: BearerTokenRequestAuthenticator.java:39
boolean isUseResourceRoleMappings()
Definition: KeycloakDeployment.java:307
int getNotBefore()
Definition: KeycloakDeployment.java:363
String surrogate
Definition: BearerTokenRequestAuthenticator.java:40
Logger log
Definition: BearerTokenRequestAuthenticator.java:37
int getIssuedAt()
Definition: JsonWebToken.java:114