[KEYCLOAK-13586] Fix typos related to QueryParamterTokenRequestAuthenticator
This commit is contained in:
parent
f9f71039ae
commit
74c379c3df
2 changed files with 9 additions and 9 deletions
|
@ -26,11 +26,11 @@ import org.keycloak.adapters.spi.HttpFacade;
|
||||||
* @author <a href="mailto:john.ament@spartasystems.com">John D. Ament</a>
|
* @author <a href="mailto:john.ament@spartasystems.com">John D. Ament</a>
|
||||||
* @version $Revision: 1 $
|
* @version $Revision: 1 $
|
||||||
*/
|
*/
|
||||||
public class QueryParamterTokenRequestAuthenticator extends BearerTokenRequestAuthenticator {
|
public class QueryParameterTokenRequestAuthenticator extends BearerTokenRequestAuthenticator {
|
||||||
public static final String ACCESS_TOKEN = "access_token";
|
public static final String ACCESS_TOKEN = "access_token";
|
||||||
protected Logger log = Logger.getLogger(QueryParamterTokenRequestAuthenticator.class);
|
protected Logger log = Logger.getLogger(QueryParameterTokenRequestAuthenticator.class);
|
||||||
|
|
||||||
public QueryParamterTokenRequestAuthenticator(KeycloakDeployment deployment) {
|
public QueryParameterTokenRequestAuthenticator(KeycloakDeployment deployment) {
|
||||||
super(deployment);
|
super(deployment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ public class QueryParamterTokenRequestAuthenticator extends BearerTokenRequestAu
|
||||||
return AuthOutcome.NOT_ATTEMPTED;
|
return AuthOutcome.NOT_ATTEMPTED;
|
||||||
}
|
}
|
||||||
tokenString = null;
|
tokenString = null;
|
||||||
tokenString = getAccessTokenFromQueryParamter(exchange);
|
tokenString = getAccessTokenFromQueryParameter(exchange);
|
||||||
if (tokenString == null || tokenString.trim().isEmpty()) {
|
if (tokenString == null || tokenString.trim().isEmpty()) {
|
||||||
challenge = challengeResponse(exchange, OIDCAuthenticationError.Reason.NO_QUERY_PARAMETER_ACCESS_TOKEN, null, null);
|
challenge = challengeResponse(exchange, OIDCAuthenticationError.Reason.NO_QUERY_PARAMETER_ACCESS_TOKEN, null, null);
|
||||||
return AuthOutcome.NOT_ATTEMPTED;
|
return AuthOutcome.NOT_ATTEMPTED;
|
||||||
|
@ -47,7 +47,7 @@ public class QueryParamterTokenRequestAuthenticator extends BearerTokenRequestAu
|
||||||
return (authenticateToken(exchange, tokenString));
|
return (authenticateToken(exchange, tokenString));
|
||||||
}
|
}
|
||||||
|
|
||||||
String getAccessTokenFromQueryParamter(HttpFacade exchange) {
|
String getAccessTokenFromQueryParameter(HttpFacade exchange) {
|
||||||
try {
|
try {
|
||||||
if (exchange != null && exchange.getRequest() != null) {
|
if (exchange != null && exchange.getRequest() != null) {
|
||||||
return exchange.getRequest().getQueryParamValue(ACCESS_TOKEN);
|
return exchange.getRequest().getQueryParamValue(ACCESS_TOKEN);
|
|
@ -76,9 +76,9 @@ public abstract class RequestAuthenticator {
|
||||||
return AuthOutcome.AUTHENTICATED;
|
return AuthOutcome.AUTHENTICATED;
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryParamterTokenRequestAuthenticator queryParamAuth = createQueryParamterTokenRequestAuthenticator();
|
QueryParameterTokenRequestAuthenticator queryParamAuth = createQueryParameterTokenRequestAuthenticator();
|
||||||
if (log.isTraceEnabled()) {
|
if (log.isTraceEnabled()) {
|
||||||
log.trace("try query paramter auth");
|
log.trace("try query parameter auth");
|
||||||
}
|
}
|
||||||
|
|
||||||
outcome = queryParamAuth.authenticate(facade);
|
outcome = queryParamAuth.authenticate(facade);
|
||||||
|
@ -207,8 +207,8 @@ public abstract class RequestAuthenticator {
|
||||||
return new BasicAuthRequestAuthenticator(deployment);
|
return new BasicAuthRequestAuthenticator(deployment);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected QueryParamterTokenRequestAuthenticator createQueryParamterTokenRequestAuthenticator() {
|
protected QueryParameterTokenRequestAuthenticator createQueryParameterTokenRequestAuthenticator() {
|
||||||
return new QueryParamterTokenRequestAuthenticator(deployment);
|
return new QueryParameterTokenRequestAuthenticator(deployment);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void completeAuthentication(OAuthRequestAuthenticator oauth) {
|
protected void completeAuthentication(OAuthRequestAuthenticator oauth) {
|
||||||
|
|
Loading…
Reference in a new issue