59 if (
log.isTraceEnabled()) {
60 log.trace(
"--> authenticate()");
64 if (
log.isTraceEnabled()) {
65 log.trace(
"try bearer");
68 AuthOutcome outcome = bearer.authenticate(
facade);
69 if (outcome == AuthOutcome.FAILED) {
71 log.debug(
"Bearer FAILED");
72 return AuthOutcome.FAILED;
73 }
else if (outcome == AuthOutcome.AUTHENTICATED) {
74 if (
verifySSL())
return AuthOutcome.FAILED;
76 log.debug(
"Bearer AUTHENTICATED");
77 return AuthOutcome.AUTHENTICATED;
81 if (
log.isTraceEnabled()) {
82 log.trace(
"try query paramter auth");
85 outcome = queryParamAuth.authenticate(
facade);
86 if (outcome == AuthOutcome.FAILED) {
87 challenge = queryParamAuth.getChallenge();
88 log.debug(
"QueryParamAuth auth FAILED");
89 return AuthOutcome.FAILED;
90 }
else if (outcome == AuthOutcome.AUTHENTICATED) {
91 if (
verifySSL())
return AuthOutcome.FAILED;
92 log.debug(
"QueryParamAuth AUTHENTICATED");
94 return AuthOutcome.AUTHENTICATED;
99 if (
log.isTraceEnabled()) {
100 log.trace(
"try basic auth");
103 outcome = basicAuth.authenticate(
facade);
104 if (outcome == AuthOutcome.FAILED) {
106 log.debug(
"BasicAuth FAILED");
107 return AuthOutcome.FAILED;
108 }
else if (outcome == AuthOutcome.AUTHENTICATED) {
109 if (
verifySSL())
return AuthOutcome.FAILED;
110 log.debug(
"BasicAuth AUTHENTICATED");
112 return AuthOutcome.AUTHENTICATED;
118 log.debug(
"NOT_ATTEMPTED: bearer only");
119 return AuthOutcome.NOT_ATTEMPTED;
124 log.debug(
"NOT_ATTEMPTED: Treating as bearer only");
125 return AuthOutcome.NOT_ATTEMPTED;
128 if (
log.isTraceEnabled()) {
129 log.trace(
"try oauth");
133 if (
verifySSL())
return AuthOutcome.FAILED;
134 log.debug(
"AUTHENTICATED: was cached");
135 return AuthOutcome.AUTHENTICATED;
139 outcome = oauth.authenticate();
140 if (outcome == AuthOutcome.FAILED) {
142 return AuthOutcome.FAILED;
143 }
else if (outcome == AuthOutcome.NOT_ATTEMPTED) {
145 return AuthOutcome.NOT_ATTEMPTED;
149 if (
verifySSL())
return AuthOutcome.FAILED;
154 facade.getResponse().setHeader(
"Location", oauth.getStrippedOauthParametersRequestUri());
155 facade.getResponse().setStatus(302);
156 facade.getResponse().end();
158 log.debug(
"AUTHENTICATED");
159 return AuthOutcome.AUTHENTICATED;
boolean isAutodetectedBearerOnly(HttpFacade.Request request)
Definition: RequestAuthenticator.java:171
BasicAuthRequestAuthenticator createBasicAuthAuthenticator()
Definition: RequestAuthenticator.java:207
HttpFacade facade
Definition: RequestAuthenticator.java:35
QueryParamterTokenRequestAuthenticator createQueryParamterTokenRequestAuthenticator()
Definition: RequestAuthenticator.java:211
BearerTokenRequestAuthenticator createBearerTokenAuthenticator()
Definition: RequestAuthenticator.java:203
KeycloakDeployment deployment
Definition: RequestAuthenticator.java:38
boolean isCached(RequestAuthenticator authenticator)
void completeAuthentication(OAuthRequestAuthenticator oauth)
Definition: RequestAuthenticator.java:215
abstract OAuthRequestAuthenticator createOAuthAuthenticator()
AuthChallenge challenge
Definition: RequestAuthenticator.java:36
AdapterTokenStore tokenStore
Definition: RequestAuthenticator.java:39
static Logger log
Definition: RequestAuthenticator.java:34
boolean isEnableBasicAuth()
Definition: KeycloakDeployment.java:227
boolean verifySSL()
Definition: RequestAuthenticator.java:162
boolean isBearerOnly()
Definition: KeycloakDeployment.java:211