[Yanel-commits] rev 35233 - public/yanel/trunk/src/webapp/src/java/org/wyona/yanel/servlet

michi at wyona.com michi at wyona.com
Fri Apr 11 01:17:33 CEST 2008


Author: michi
Date: 2008-04-11 01:17:33 +0200 (Fri, 11 Apr 2008)
New Revision: 35233

Modified:
   public/yanel/trunk/src/webapp/src/java/org/wyona/yanel/servlet/YanelServlet.java
Log:
comments and log statements improved

Modified: public/yanel/trunk/src/webapp/src/java/org/wyona/yanel/servlet/YanelServlet.java
===================================================================
--- public/yanel/trunk/src/webapp/src/java/org/wyona/yanel/servlet/YanelServlet.java	2008-04-10 18:31:35 UTC (rev 35232)
+++ public/yanel/trunk/src/webapp/src/java/org/wyona/yanel/servlet/YanelServlet.java	2008-04-10 23:17:33 UTC (rev 35233)
@@ -1081,10 +1081,22 @@
             }
 
             if(doAuthenticate(request, response) != null) {
-                log.warn("Authentication either failed or no credentials provided yet!");
+                log.warn("Return response of web authenticator.");
+                /*
+		  NOTE: Such a response can have different reasons:
+                        - Either no credentials provided yet and web authenticator is generating a response to fetch credentials
+                        - Or authentication failed and web authenticator is resending response to fetch again credentials");
+                        - Or authentication was successful and web authenticator sends a redirect
+                */
                 return response;
 	    } else {
-                log.warn("Authentication was successful!");
+                try {
+                    log.warn("Authentication was successful for user: " + getIdentity(request).getUsername());
+                } catch (Exception e) {
+                    log.error(e, e);
+                }
+                log.warn("TODO: Add user to session listener!");
+
                 URL url = new URL(getRequestURLQS(request, null, false).toString());
                 if (sslPort != null) {
                     url = new URL("https", url.getHost(), new Integer(sslPort).intValue(), url.getFile());
@@ -1285,7 +1297,7 @@
 
     /**
      * Authentication
-     * @return null when authentication successful or has already been authenticated, otherwise return response
+     * @return null when authentication successful or has already been authenticated, otherwise return response generated by web authenticator
      */
     public HttpServletResponse doAuthenticate(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
         try {
@@ -1712,8 +1724,7 @@
     /**
      * Gets the identity from the session associated with the given request.
      * @param request
-     * @return identity or null if there is no identity in the session for the current
-     *                  realm or if there is no session at all
+     * @return identity or null if there is no identity in the session for the current realm or if there is no session at all
      */
     private Identity getIdentity(HttpServletRequest request) throws Exception {
         Realm realm = map.getRealm(request.getServletPath());



More information about the Yanel-commits mailing list