From 0b3ae30473444d19c1b67c0b86741e9c9943aff2 Mon Sep 17 00:00:00 2001 From: rmartinc Date: Thu, 23 Nov 2017 11:18:29 +0100 Subject: [PATCH] Parameter "ui_locales" not redirected to login page in java adapters --- .../org/keycloak/adapters/OAuthRequestAuthenticator.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/OAuthRequestAuthenticator.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/OAuthRequestAuthenticator.java index 8d875ee4eb..6d7e6608b0 100755 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/OAuthRequestAuthenticator.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/OAuthRequestAuthenticator.java @@ -170,6 +170,9 @@ public class OAuthRequestAuthenticator { String maxAge = getQueryParamValue(OAuth2Constants.MAX_AGE); url = UriUtils.stripQueryParam(url, OAuth2Constants.MAX_AGE); + String uiLocales = getQueryParamValue(OAuth2Constants.UI_LOCALES_PARAM); + url = UriUtils.stripQueryParam(url, OAuth2Constants.UI_LOCALES_PARAM); + KeycloakUriBuilder redirectUriBuilder = deployment.getAuthUrl().clone() .queryParam(OAuth2Constants.RESPONSE_TYPE, OAuth2Constants.CODE) .queryParam(OAuth2Constants.CLIENT_ID, deployment.getResourceName()) @@ -188,6 +191,9 @@ public class OAuthRequestAuthenticator { if (maxAge != null && maxAge.length() > 0) { redirectUriBuilder.queryParam(OAuth2Constants.MAX_AGE, maxAge); } + if (uiLocales != null && uiLocales.length() > 0) { + redirectUriBuilder.queryParam(OAuth2Constants.UI_LOCALES_PARAM, uiLocales); + } scope = TokenUtil.attachOIDCScope(scope); redirectUriBuilder.queryParam(OAuth2Constants.SCOPE, scope);