Using Acegi Security for Remember Me and SSL Switching
I spent some time yesterday converting AppFuse's homegrown Remember Me and SSL Switching system to using Acegi Security. Thanks to Justin Spears, who provided the original motivation. It was much easier than I thought it would be, and resulted in the deleting of 7 classes in AppFuse. Not only that, but only one of them had a test for it, so the test coverage has naturally gone up as well. I'll trade 40 lines of XML for 1214 lines of Java any day - especially when I can get the support of an open-source framework.
If you're interested in using this code over 1.8.2, you can checkout the latest code from CVS (or download it from http://appfuse.org/nightly). The only other change currently in CVS is changing from "tomcat" to "user" as the default User role. Below is a list of classes that were removed as part of this move to Acegi:
- src/dao/org/appfuse/model/UserCookie.java
- src/service/org/appfuse/util/RandomGUID.java
- src/web/org/appfuse/webapp/action/LoginServlet.java
- src/web/org/appfuse/webapp/filter/LoginFilter.java
- src/web/org/appfuse/webapp/taglib/SecureTag.java
- src/web/org/appfuse/webapp/util/SslUtil.java
- test/web/org/appfuse/webapp/action/LoginServletTest.java
I should also mention that I owe a big thanks to Virtuas - who pays me to work on AppFuse these days.
I've done the same thing for my own app (http://tudu.sf.net), and of course I agree with you. However I have a slight problem with Acegi's remember-me implementation : the cookie stored in the user's computer contains the user password (in a md5 hash). So it's possible to find a user's password with this system, which was not possible with Appuse's home-made solution.
Of course, this is only for the paranoid, and once again I've chosen the same solution for my own app.
Julien Dubois.
Posted by Julien Dubois on August 29, 2005 at 04:26 PM MDT #
The only hard things I found in this integration was detecting when RememberMe was being used, as well as when Password Encryption was turned on. My current logic detecting password encryption and remember me enabled is:
As far as detecting when Remember Me is used to login, I'm using:
Posted by Matt Raible on August 29, 2005 at 04:42 PM MDT #
Posted by root on August 29, 2005 at 05:23 PM MDT #
Posted by Ben C on August 30, 2005 at 12:39 PM MDT #
Posted by Matt Raible on August 30, 2005 at 02:03 PM MDT #
Posted by Ben C on August 30, 2005 at 05:19 PM MDT #
Posted by Christina on August 30, 2005 at 07:13 PM MDT #
Posted by George Franciscus on September 01, 2005 at 05:32 PM MDT #
Posted by joe on September 13, 2005 at 08:54 AM MDT #
Posted by Matt Raible on September 13, 2005 at 12:41 PM MDT #
Posted by 220.225.70.181 on November 09, 2006 at 04:20 PM MST #