Skip to content

Commit

Permalink
[ELY-2374] Add support domain_hint query parameter
Browse files Browse the repository at this point in the history
Azure AD allows to pass the domain_hint parameter to the /authorize
endpoint which helps user account selection (see https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow#request-an-authorization-code).
This commit adds support for appending this parameter to the redirect
uri.
  • Loading branch information
cboehme authored and fjuma committed Aug 16, 2022
1 parent 689636f commit 26515d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public class Oidc {
public static final String ERROR = "error";
public static final String GRANT_TYPE = "grant_type";
public static final String LOGIN_HINT = "login_hint";
public static final String DOMAIN_HINT = "domain_hint";
public static final String MAX_AGE = "max_age";
public static final String PASSWORD = "password";
public static final String PROMPT = "prompt";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import static org.wildfly.security.http.oidc.ElytronMessages.log;
import static org.wildfly.security.http.oidc.Oidc.CLIENT_ID;
import static org.wildfly.security.http.oidc.Oidc.CODE;
import static org.wildfly.security.http.oidc.Oidc.DOMAIN_HINT;
import static org.wildfly.security.http.oidc.Oidc.ERROR;
import static org.wildfly.security.http.oidc.Oidc.KC_IDP_HINT;
import static org.wildfly.security.http.oidc.Oidc.LOGIN_HINT;
Expand Down Expand Up @@ -163,7 +164,7 @@ protected String getRedirectUri(String state) {
url = uriBuilder.build().toString();
}

List<String> forwardableQueryParams = Arrays.asList(LOGIN_HINT, KC_IDP_HINT, PROMPT, MAX_AGE, UI_LOCALES, SCOPE);
List<String> forwardableQueryParams = Arrays.asList(LOGIN_HINT, DOMAIN_HINT, KC_IDP_HINT, PROMPT, MAX_AGE, UI_LOCALES, SCOPE);
List<NameValuePair> forwardedQueryParams = new ArrayList<>(forwardableQueryParams.size());
for (String paramName : forwardableQueryParams) {
String paramValue = getQueryParamValue(facade, paramName);
Expand Down

0 comments on commit 26515d2

Please sign in to comment.