RE: J2EE App Server Security
Dion and Christian are talking about J2EE App Server Security. Specifically, they are talking about setting up standard container-managed security. J2EE allows you to specify security settings in your web.xml, but to make those work - you have to configure your app server. For Tomcat, this is pretty easy, and Resin makes it easy too. However, the XML you have to write for both is quite different and some app servers don't even let you write XML - instead you have to use their "admin console". Personally, I think most admin consoles are a pain in the ass. I'd prefer to write a single XML file to configure the server. Some servers require several files just to authenticate against a database.
AppFuse uses both container-managed authentication and a JNDI DataSource. This means you have to configure the appserver in order to run AppFuse. On many servers, this is difficult to do (or, they didn't pass my 10 minute test at least). I like servers where I can deploy a couple of JARs into a directory and a single XML file to configure the server. Tomcat and Resin come to mind.
After using Acegi for the last month, I think I'm going to ditch the "standard" J2EE security stuff. I managed to port AppFuse to use Acegi last month - and didn't have to change a single line of security-related code. The hardest parts of integrating Acegi where 1) figuring out how to build it from CVS (there's currently two src trees) and 2) excluding URLs. Once I got these two things solved, I had to add an "enabled" column to my user table, but that's about it. This is awesome b/c it means you can always port back to CMA with very few code changes.
I used to think that using the container's resources was a good thing, but I'm starting to change my mind. Spring allows you to configure a DataSource connection pool just like Tomcat does, so there's not as many benefits as there once was. Being able to drop a WAR into a directory and have your app work without configuring the server is a very nice thing. What do you think? Are there any advantages to using a container's services anymore? I suppose there is for distributed or clustered apps, but that's all I can think of.
Single Sign-On? Tomcat lets you log into 1 webapp and then you're authenticated for all of the webapps running under that Tomcat instance. I assume this is a feature described in the J2EE spec. I have to admit that I don't know enough about Spring or Acegi to know whether this capability exists in them. In general though, I *do* agree with you. It's much more desirable to just drop a WAR file in (or deploy via Ant task).
The whole J2EE Realm architecture has a number of pretty big flaws. If you could just define a realm in the app's web.xml that would help a great deal.
Posted by kelzer on January 04, 2005 at 06:10 PM MST #
Posted by Rob Kischuk on January 04, 2005 at 06:23 PM MST #
Posted by Anthony Eden on January 04, 2005 at 06:46 PM MST #
Posted by Karsten Voges on January 04, 2005 at 07:13 PM MST #
Posted by Anthony Eden on January 04, 2005 at 07:26 PM MST #
Posted by Kim Pepper on January 04, 2005 at 09:25 PM MST #
Posted by John G. Norman on January 04, 2005 at 11:50 PM MST #
Although doing this ties me to Tomcat for now, thats what I was planning to use anyway. I did have some problems where signing out of one app didnt sign them all out, so made some minor modifications and added some filters to the other applications that intercept the login/logout/register pages, and redirect to the appropriate page in my main application. This gives a consistant login/logout page which is good anyway.
Posted by Dan Campers on January 05, 2005 at 01:08 AM MST #
Posted by Ben Alex on January 05, 2005 at 09:19 AM MST #
Posted by Brian Repko on January 05, 2005 at 03:22 PM MST #
Posted by maybenull on January 07, 2005 at 03:44 PM MST #
I was developing a simle webapp last month, by studying AppFuse 1.7. I also started to use Acegi as my security suite - it's quite suitable for my app. But AppFuse (1.7 I mean) has its own security implementation, so I tried to integrate it by myself... (At that time I just couldn't realize that's a nice resource like this: AppFuseSecurity, Okay, lastly I was able to do so just for a simple login) </br> Now I know there's AppFuse 1.8, where can I get it? I'd like to know more about the integration, in particular, the cookie-automatic logon (aka 'remember me'). How to get this feature done? Oh, and one more question, which acegi version does AppFuse using? 1.6.1 or latest 1.7? Anyway, I believe the upgrading effort would not be so heavy.
And for SSO, I'd like to know if anyone using it for your webapps? Is CAS nice? =P
Posted by Hue on January 22, 2005 at 02:34 AM MST #
Posted by Matt Raible on January 24, 2005 at 04:30 AM MST #
Posted by Renato Eschini on September 26, 2005 at 08:18 AM MDT #
Posted by James on August 10, 2006 at 04:24 PM MDT #
Posted by Dung Nguyen on January 09, 2007 at 01:19 PM MST #
Posted by Matt Raible on January 10, 2007 at 01:25 AM MST #