Update of /var/cvs/contributions/didactor2/src/core/java/nl/didactor/security
In directory james.mmbase.org:/tmp/cvs-serv5992
Modified Files:
Authentication.java
Log Message:
debugging, made method=http working
See also:
http://cvs.mmbase.org/viewcvs/contributions/didactor2/src/core/java/nl/didactor/security
Index: Authentication.java
===================================================================
RCS file:
/var/cvs/contributions/didactor2/src/core/java/nl/didactor/security/Authentication.java,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -b -r1.34 -r1.35
--- Authentication.java 20 Mar 2008 19:56:34 -0000 1.34
+++ Authentication.java 27 Mar 2008 17:39:34 -0000 1.35
@@ -108,7 +108,7 @@
* @since Didactor-2.3
*/
protected void logout(HttpServletRequest request, HttpServletResponse
response) {
- log.debug("Processing didactor logout");
+ log.debug("Processing didactor logout because ", new Exception());
HttpSession session = request == null ? null :
request.getSession(false);
if (session != null) {
String loginComponent =
(String)session.getAttribute("didactor-logincomponent");
@@ -244,7 +244,16 @@
}
}
- log.debug("Apparently not logged in yet, try to do that now");
+ log.debug("Apparently not logged in yet, try to do that now: " +
application);
+
+
+ if ("name/password".equals(application)) {
+ log.debug("Found 'name/password' application. Decorating request
with name/password.");
+ request.setAttribute("username", loginInfo.get("username"));
+ request.setAttribute("password", loginInfo.get("password"));
+ application = "login";
+ }
+
// Apparently not, so we ask the components if they can process the
login,
// maybe there was a post to the current page?
for (AuthenticationComponent ac : securityComponents) {
@@ -284,11 +293,6 @@
return new UserContext("anonymous", "anonymous", Rank.ANONYMOUS,
"asis");
}
- if ("name/password".equals(application)) {
- request.setAttribute("username", loginInfo.get("username"));
- request.setAttribute("password", loginInfo.get("password"));
- application = "login";
- }
assert application.equals("login") : "Unknown security application "
+ application;
@@ -321,9 +325,10 @@
}
// how about the paramters already present. This seems to
be too simple. Escaping?
String redirect =
response.encodeRedirectURL(referUrl.toString());
+ log.debug("Redirecting to " + redirect);
response.sendRedirect(redirect);
} catch (Exception e) {
- throw new SecurityException("Can't redirect to login
page(" + loginPage + ")", e);
+ throw new SecurityException("Can't redirect to login
page(" + loginPage + ") because " + e.getClass() + ":" + e.getMessage(), e);
}
return null;
}
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs