geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwo...@apache.org
Subject svn commit: r926985 - /geronimo/external/trunk/tomcat-parent-6.0.26/catalina/src/main/java/org/apache/catalina/authenticator/BasicAuthenticator.java
Date Wed, 24 Mar 2010 09:21:13 GMT
Author: rwonly
Date: Wed Mar 24 09:21:12 2010
New Revision: 926985

URL: http://svn.apache.org/viewvc?rev=926985&view=rev
Log:
revert the changes in rev.923622 & rev.923649 for GERONIMO-5129

Modified:
    geronimo/external/trunk/tomcat-parent-6.0.26/catalina/src/main/java/org/apache/catalina/authenticator/BasicAuthenticator.java

Modified: geronimo/external/trunk/tomcat-parent-6.0.26/catalina/src/main/java/org/apache/catalina/authenticator/BasicAuthenticator.java
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/tomcat-parent-6.0.26/catalina/src/main/java/org/apache/catalina/authenticator/BasicAuthenticator.java?rev=926985&r1=926984&r2=926985&view=diff
==============================================================================
--- geronimo/external/trunk/tomcat-parent-6.0.26/catalina/src/main/java/org/apache/catalina/authenticator/BasicAuthenticator.java
(original)
+++ geronimo/external/trunk/tomcat-parent-6.0.26/catalina/src/main/java/org/apache/catalina/authenticator/BasicAuthenticator.java
Wed Mar 24 09:21:12 2010
@@ -21,8 +21,9 @@ package org.apache.catalina.authenticato
 
 import java.io.IOException;
 import java.security.Principal;
-import javax.servlet.http.HttpServletRequest;
+
 import javax.servlet.http.HttpServletResponse;
+
 import org.apache.catalina.connector.Request;
 import org.apache.catalina.connector.Response;
 import org.apache.catalina.deploy.LoginConfig;
@@ -82,8 +83,6 @@ public class BasicAuthenticator
     protected static final String info =
         "org.apache.catalina.authenticator.BasicAuthenticator/1.0";
     
-    protected static final String negotiate="org.apache.tomcat.config.NEGOTIATE" ;
-
 
     // ------------------------------------------------------------- Properties
 
@@ -118,27 +117,8 @@ public class BasicAuthenticator
     public boolean authenticate(Request request,
                                 Response response,
                                 LoginConfig config)
-        throws IOException {                
-        if (System.getProperty(negotiate, "false").equalsIgnoreCase("true")) {          
 
-            HttpServletRequest httpRequest = request.getRequest();
-            String header = httpRequest.getHeader("Authorization");
-            if (header == null) {
-                HttpServletResponse httpResponse = response.getResponse();
-                httpResponse.setHeader("WWW-Authenticate", "Negotiate");
-                httpResponse.setStatus(401);
-                return false;
-            } else if (header != null && header.startsWith("Negotiate")) {
-                Principal principal = request.getUserPrincipal();
-                String username = header.substring(10);
-                String password = null;
-                principal = context.getRealm().authenticate(username, password);
-                if (principal != null) {
-                    register(request, response, principal, Constants.BASIC_METHOD, username,
password);
-                    return true;
-                } else
-                    request.getCoyoteRequest().getMimeHeaders().removeHeader("authorization");
-            }
-        }
+        throws IOException {
+               
         // Have we already authenticated someone?
         Principal principal = request.getUserPrincipal();
         String ssoId = (String) request.getNote(Constants.REQ_SSOID_NOTE);
@@ -194,10 +174,11 @@ public class BasicAuthenticator
                     username = new String(buf, 0, colon);
                     password = new String(buf, colon + 1, 
                             authorizationCC.getEnd() - colon - 1);
-                       }
+                }
                 
                 authorizationBC.setOffset(authorizationBC.getOffset() - 6);
             }
+
             principal = context.getRealm().authenticate(username, password);
             if (principal != null) {
                 register(request, response, principal, Constants.BASIC_METHOD,
@@ -206,6 +187,7 @@ public class BasicAuthenticator
             }
         }
         
+
         // Send an "unauthorized" response and an appropriate challenge
         MessageBytes authenticate = 
             response.getCoyoteResponse().getMimeHeaders()
@@ -224,5 +206,8 @@ public class BasicAuthenticator
         response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
         //response.flushBuffer();
         return (false);
+
     }
+
+
 }



Mime
View raw message