From 774cd11aab4190845ecbca429ba1bc1297e8c802 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Mon, 17 Dec 2007 00:10:49 +0000 Subject: [PATCH] login URL is different if we are to be authenticated by the container. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@6320 71c3de6d-444a-0410-be80-ed276b4c234a --- .../main/java/hudson/security/LegacySecurityRealm.java | 9 +++++++++ core/src/main/java/hudson/security/SecurityRealm.java | 8 ++++++++ core/src/main/resources/hudson/model/Hudson/login.jelly | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/security/LegacySecurityRealm.java b/core/src/main/java/hudson/security/LegacySecurityRealm.java index 251eaba8af..e618ad2e0d 100644 --- a/core/src/main/java/hudson/security/LegacySecurityRealm.java +++ b/core/src/main/java/hudson/security/LegacySecurityRealm.java @@ -23,6 +23,15 @@ public final class LegacySecurityRealm extends SecurityRealm implements Authenti return null; } + /** + * To have the username/password authenticated by the container, + * submit the form to the URL defined by the servlet spec. + */ + @Override + public String getLoginUrl() { + return "j_security_check"; + } + public Descriptor getDescriptor() { return DESCRIPTOR; } diff --git a/core/src/main/java/hudson/security/SecurityRealm.java b/core/src/main/java/hudson/security/SecurityRealm.java index 162c1c3281..e580826d3a 100644 --- a/core/src/main/java/hudson/security/SecurityRealm.java +++ b/core/src/main/java/hudson/security/SecurityRealm.java @@ -33,6 +33,14 @@ public abstract class SecurityRealm implements Describable, Exten */ public abstract AuthenticationManager createAuthenticationManager(); + /** + * Returns the URL to submit a form for the authentication. + * Normally there's no need to override this. + */ + public String getLoginUrl() { + return "j_acegi_security_check"; + } + /** * Picks up the instance of the given type from the spring context. * If there are multiple beans of the same type or if there are none, diff --git a/core/src/main/resources/hudson/model/Hudson/login.jelly b/core/src/main/resources/hudson/model/Hudson/login.jelly index 3d8d7fb2bf..c664cf04c9 100644 --- a/core/src/main/resources/hudson/model/Hudson/login.jelly +++ b/core/src/main/resources/hudson/model/Hudson/login.jelly @@ -4,7 +4,7 @@
-
+
User: