Source:
public void run() { ui.header("User Authentication"); final AuthType auth_type = auth.select("Authentication method", "type", AuthType.OPENID); switch (auth_type) { case HTTP: case HTTP_LDAP: { String hdr = auth.get("httpHeader"); if (ui.yesno(hdr != null, "Get username from custom HTTP header")) { auth.string("Username HTTP header", "httpHeader", "SM_USER"); } else if (hdr != null) { auth.unset("httpHeader"); } auth.string("SSO logout URL", "logoutUrl", null); break; } case OAUTH: case CLIENT_SSL_CERT_LDAP: case CUSTOM_EXTENSION: case DEVELOPMENT_BECOME_ANY_ACCOUNT: case LDAP: case LDAP_BIND: case OPENID: case OPENID_SSO: break; } switch (auth_type) { case LDAP: case LDAP_BIND: case HTTP_LDAP: { String server = ldap.string("LDAP server", "server", "ldap://localhost"); if (server != null && !server.startsWith("ldap://") && !server.startsWith("ldaps://")) { if (ui.yesno(false, "Use SSL")) { server = "ldaps://" + server; } else { server = "ldap://" + server; } ldap.set("server", server); } ldap.string("LDAP username", "username", null); ldap.password("username", "password"); String aBase = ldap.string("Account BaseDN", "accountBase", dnOf(server)); ldap.string("Group BaseDN", "groupBase", aBase); break; } case OAUTH: case CLIENT_SSL_CERT_LDAP: case CUSTOM_EXTENSION: case DEVELOPMENT_BECOME_ANY_ACCOUNT: case HTTP: case OPENID: case OPENID_SSO: break; } if (auth.getSecure("registerEmailPrivateKey") == null) { auth.setSecure("registerEmailPrivateKey", SignedToken.generateRandomKey()); } if (auth.getSecure("restTokenPrivateKey") == null) { auth.setSecure("restTokenPrivateKey", SignedToken.generateRandomKey()); } }

Target:
public void run() { ui.header("User Authentication"); final AuthType auth_type = auth.select("Authentication method", "type", AuthType.OPENID); switch (auth_type) { case HTTP: case HTTP_LDAP: { String hdr = auth.get("httpHeader"); if (ui.yesno(hdr != null, "Get username from custom HTTP header")) { auth.string("Username HTTP header", "httpHeader", "SM_USER"); } else if (hdr != null) { auth.unset("httpHeader"); } auth.string("SSO logout URL", "logoutUrl", null); break; } case CLIENT_SSL_CERT_LDAP: case CUSTOM_EXTENSION: case DEVELOPMENT_BECOME_ANY_ACCOUNT: case LDAP: case LDAP_BIND: case OAUTH: case OPENID: case OPENID_SSO: break; } switch (auth_type) { case LDAP: case LDAP_BIND: case HTTP_LDAP: { String server = ldap.string("LDAP server", "server", "ldap://localhost"); if (server != null && !server.startsWith("ldap://") && !server.startsWith("ldaps://")) { if (ui.yesno(false, "Use SSL")) { server = "ldaps://" + server; } else { server = "ldap://" + server; } ldap.set("server", server); } ldap.string("LDAP username", "username", null); ldap.password("username", "password"); String aBase = ldap.string("Account BaseDN", "accountBase", dnOf(server)); ldap.string("Group BaseDN", "groupBase", aBase); break; } case CLIENT_SSL_CERT_LDAP: case CUSTOM_EXTENSION: case DEVELOPMENT_BECOME_ANY_ACCOUNT: case HTTP: case OAUTH: case OPENID: case OPENID_SSO: break; } if (auth.getSecure("registerEmailPrivateKey") == null) { auth.setSecure("registerEmailPrivateKey", SignedToken.generateRandomKey()); } if (auth.getSecure("restTokenPrivateKey") == null) { auth.setSecure("restTokenPrivateKey", SignedToken.generateRandomKey()); } }