String[] mechanisms = mechName.split(",");
for (String mechanism : mechanisms) {
if (mechanism.equalsIgnoreCase(BASIC_AUTH)) {
// The mechanism name is passed in from the HttpServletRequest interface as the name reported needs to be
// comparable using '=='
authenticationMechanisms.add(new BasicAuthenticationMechanism(loginConfig.getRealmName(), BASIC_AUTH));
} else if (mechanism.equalsIgnoreCase("BASIC-SILENT")) {
//slient basic auth with use the basic headers if available, but will never challenge
//this allows programtic clients to use basic auth, and browsers to use other mechanisms
authenticationMechanisms.add(new BasicAuthenticationMechanism(loginConfig.getRealmName(), "BASIC-SILENT", true));
} else if (mechanism.equalsIgnoreCase(FORM_AUTH)) {
// The mechanism name is passed in from the HttpServletRequest interface as the name reported needs to be
// comparable using '=='
authenticationMechanisms.add(new ServletFormAuthenticationMechanism(FORM_AUTH, loginConfig.getLoginPage(),
loginConfig.getErrorPage()));