Allows explicit login with auth.type = HTTP*

When auth.type = HTTP or HTTP_LDAP, allows the configuration of an
explicit login URL in order to trigger the authentication process of
the front-end SSO system.

URL and link name are customizable using:

  * auth.loginUrl
  * auth.loginText

Configuring a server with auth.loginUrl allows an unknown user not yet
logged in to perform anonymous browsing of Gerrit, as allowed by other
auth.type methods.

Change-Id: I52aa7950fdf0ba23a55a7d4eb5f1f1e3f6be6b38
This commit is contained in:
Luca Milanesio
2013-07-27 22:03:06 +01:00
committed by Shawn Pearce
parent da16183775
commit 5185b040d3
7 changed files with 69 additions and 6 deletions

View File

@@ -729,8 +729,6 @@ public class Gerrit implements EntryPoint {
whoAmI(cfg.getAuthType() != AuthType.CLIENT_SSL_CERT_LDAP);
} else {
switch (cfg.getAuthType()) {
case HTTP:
case HTTP_LDAP:
case CLIENT_SSL_CERT_LDAP:
break;
@@ -759,6 +757,14 @@ public class Gerrit implements EntryPoint {
});
break;
case HTTP:
case HTTP_LDAP:
if (cfg.getLoginUrl() != null) {
final String signinText = cfg.getLoginText() == null ? C.menuSignIn() : cfg.getLoginText();
menuRight.add(anchor(signinText, cfg.getLoginUrl()));
}
break;
case LDAP:
case LDAP_BIND:
case CUSTOM_EXTENSION: