geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: rev 51819 - geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty
Date Sun, 03 Oct 2004 02:04:15 GMT
Author: adc
Date: Sat Oct  2 19:04:14 2004
New Revision: 51819

Modified:
   geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppJACCContext.java
Log:
Too strict checking on access to login page
http://issues.apache.org/jira/browse/GERONIMO-323

Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppJACCContext.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppJACCContext.java
(original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppJACCContext.java
Sat Oct  2 19:04:14 2004
@@ -90,6 +90,8 @@
 
     private PathMap _constraintMap = new PathMap();
 
+    private String formLoginPath;
+
     public JettyWebAppJACCContext() {
         this(null, null, null, null, null, null, null, null, null, null, null, null);
     }
@@ -206,6 +208,12 @@
      */
     public boolean checkSecurityConstraints(String pathInContext, HttpRequest request, HttpResponse
response) throws HttpException, IOException {
 
+        if (formLoginPath != null) {
+            String pathToBeTested = (pathInContext.indexOf('?') > 0 ? pathInContext.substring(0,
pathInContext.indexOf('?')) : pathInContext);
+
+            if (pathToBeTested.equals(formLoginPath)) return true;
+        }
+
         try {
             Principal user = obtainUser(pathInContext, request, response);
 
@@ -366,6 +374,14 @@
     public void doStart() throws WaitingException, Exception {
 
         super.doStart();
+
+        Authenticator authenticator = getAuthenticator();
+        if (authenticator instanceof FormAuthenticator) {
+            formLoginPath = ((FormAuthenticator) authenticator).getLoginPage();
+            if (formLoginPath.indexOf('?') > 0) {
+                formLoginPath = formLoginPath.substring(0, formLoginPath.indexOf('?'));
+            }
+        }
 
         /**
          * Register our default principal with the ContextManager

Mime
View raw message