Skip to content

Commit

Permalink
Add the ability to specify the auth choice as a URL param, which will…
Browse files Browse the repository at this point in the history
… skip the auth choice page.

Issue: SAK-29092
  • Loading branch information
steveswinsburg committed Mar 1, 2015
1 parent 69d5009 commit 6120625
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ public class SkinnableLogin extends HttpServlet implements Login {
private transient LoginService loginService;

private static ResourceLoader rb = new ResourceLoader("auth");

// the list of login choices that could be supplied
enum AuthChoices {
CONTAINER,
XLOGIN
}


private String loginContext;
Expand Down Expand Up @@ -188,7 +194,16 @@ else if ("/xlogin".equals(option))
}
return;
}

//SAK-29092 if an auth is specified in the URL, skip any other checks and go straight to it
String authPreferred = req.getParameter("auth");
log.debug("authPreferred: " + authPreferred);

if(StringUtils.equalsIgnoreCase(authPreferred, AuthChoices.XLOGIN.toString())) {
log.debug("Going straight to xlogin");
skipContainer = true;
}

// see if we need to check container
boolean checkContainer = serverConfigurationService.getBoolean("container.login", false);
if (checkContainer && !skipContainer)
Expand Down Expand Up @@ -221,6 +236,11 @@ else if ("/xlogin".equals(option))
}
String helperPath = helperUrl == null ? null : helperUrl.getPath();

if(StringUtils.equalsIgnoreCase(authPreferred, AuthChoices.CONTAINER.toString())) {
log.debug("Going straight to container login");
showAuthChoice = false;
}

if (showAuthChoice && !(StringUtils.isEmpty(helperPath) || helperPath.equals("/portal") ||
helperPath.equals("/portal/") || helperPath.equals("/portal/pda") || helperPath.equals("/portal/pda/"))) {
String xloginUrl = serverConfigurationService.getPortalUrl() + "/xlogin";
Expand Down

0 comments on commit 6120625

Please sign in to comment.