Add some logging
authorlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 3 Jul 2007 18:08:01 +0000 (18:08 +0000)
committerlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 3 Jul 2007 18:08:01 +0000 (18:08 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@2285 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/idp/authn/provider/RemoteUserAuthServlet.java
src/edu/internet2/middleware/shibboleth/idp/authn/provider/RemoteUserAuthenticationHandler.java

index 844e235..392cf49 100644 (file)
@@ -23,6 +23,8 @@ import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.log4j.Logger;
+
 import edu.internet2.middleware.shibboleth.idp.authn.AuthenticationEngine;
 import edu.internet2.middleware.shibboleth.idp.authn.AuthenticationHandler;
 
@@ -32,11 +34,19 @@ import edu.internet2.middleware.shibboleth.idp.authn.AuthenticationHandler;
 public class RemoteUserAuthServlet extends HttpServlet {
 
     /** Serial version UID. */
-    private static final long serialVersionUID = -4073010252382266761L;
+    private static final long serialVersionUID = 1745454095756633626L;
+
+    /** Class logger. */
+    private final Logger log = Logger.getLogger(RemoteUserAuthServlet.class);
 
     /** {@inheritDoc} */
     protected void service(HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws ServletException,
             IOException {
+        String principalName = httpRequest.getRemoteUser();
+
+        if (log.isDebugEnabled()) {
+            log.debug("Remote user identified as " + principalName + " returning control back to authenticate engine");
+        }
         httpRequest.setAttribute(AuthenticationHandler.PRINCIPAL_NAME_KEY, httpRequest.getRemoteUser());
         AuthenticationEngine.returnToAuthenticationEngine(httpRequest, httpResponse);
     }
index aa63622..ac6c5ba 100644 (file)
@@ -59,6 +59,9 @@ public class RemoteUserAuthenticationHandler extends AbstractAuthenticationHandl
 
         // forward control to the servlet.
         try {
+            if(log.isDebugEnabled()){
+                log.debug("Forwarding control to servlet " + servletURL + " which is hopefully container protected.");
+            }
             RequestDispatcher dispatcher = httpRequest.getRequestDispatcher(servletURL);
             dispatcher.forward(httpRequest, httpResponse);
             return;