Skip to content

Commit

Permalink
Only skip reading idps for account and origin chooser
Browse files Browse the repository at this point in the history
  • Loading branch information
tack-sap committed Jun 23, 2021
1 parent 5c255ef commit 25629c7
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,11 @@ private String login(Model model, Principal principal, List<String> excludedProm
allIdentityProviders.putAll(samlIdentityProviders);
allIdentityProviders.putAll(oauthIdentityProviders);
}
} else if (!jsonResponse && (accountChooserNeeded || (accountChooserEnabled && !discoveryEnabled && !discoveryPerformed))) {
// when `/login` is requested to return html response (as opposed to json response)
//Account and origin chooser do not need idp information
oauthIdentityProviders = Collections.emptyMap();
samlIdentityProviders = Collections.emptyMap();
} else {
samlIdentityProviders = getSamlIdentityProviderDefinitions(allowedIdentityProviderKeys);
oauthIdentityProviders = getOauthIdentityProviderDefinitions(allowedIdentityProviderKeys);
Expand Down Expand Up @@ -422,18 +427,15 @@ private String getUnauthenticatedRedirect(
if (hasText(formRedirectUri)) {
model.addAttribute(UaaSavedRequestAwareAuthenticationSuccessHandler.FORM_REDIRECT_PARAMETER, formRedirectUri);
}
if (accountChooserNeeded) {
return "idp_discovery/account_chooser";
}
if (discoveryEnabled) {
if (accountChooserNeeded) {
return "idp_discovery/account_chooser";
}
if (!discoveryPerformed) {
return "idp_discovery/email";
}
return goToPasswordPage(request.getParameter("email"), model);
}
if (accountChooserNeeded) {
return "idp_discovery/account_chooser";
}
if (accountChooserEnabled) {
if (model.containsAttribute("login_hint")) {
return goToPasswordPage(request.getParameter("email"), model);
Expand Down

0 comments on commit 25629c7

Please sign in to comment.