Tuesday, April 29, 2008

Websphere & Spring Security 2.0 (formerly ACEGI)

I'm doing a proof of concept to demonstrate how can Spring Security 2.0 be applied in a Websphere 6.1 environment. My goal is to secure a Webapp using Spring Security instead of J2EE Security.

The first bump in the road came when I was getting a 404 while configuring the AuthenticationProcessingFilter (Form Based Security). The form was posts to:

/j_acegi_security_check

There are several documented bugs about this filter behavior. Spring Security relies on filters so you need to enable WAS 6.1 to enable for filters to be called even when a static/file resource does not exist. Bassically you need to set a Custom Web Container property:
  1. Go to WAS 6.1 admin console to Application Servers and click on the server you want to configure
  2. Then on the right side expand the Web Container tree and select Web Conainer
  3. Click on Custom Properties
  4. Add a new property called com.ibm.ws.webcontainer.invokefilterscompatibility value true
  5. Restart the server
Now you won't get the 404 error when invoking filters that handle nonexistent locations thus Spring Security filters will work.

Wednesday, April 23, 2008

Install SpringIDE plugin on RAD 7

For those of you trying to install Spring IDE on IBM RAD 7 this post may come in handy.

I installed Spring IDE on RAD7 version 7.0.0.6, which is Eclipse 3.2.2 based. The SpringIDE plugin expects AspectJ Development Tools (AJDT) version 1.5.1 BUT this version of AJDT is not compatible with Eclipse 3.2. So in order to install the plugin you must first install AJDT 1.4.2 for Eclipse 3.2.2. Point your Eclipse Update Manager to:
Once you finish the AJDT installation its time to install the SpringIDE plugin. If you pay close attention to the SpringIDE installation instructions, you'll notice SpringIDE requires a Eclipse 3.2 or 3.3, so if you are doing a Clean Install, you should install the Spring IDE Dependencies (required for Eclipse 3.2.).

Having that in mind, launch RAD7 and add a new Remote Site in the Eclipse Update Manager potinting to http://springide.org/updatesite . Be sure to select ONLY the foloowing packages (I'm not integrating with Mylyn by the way):
  • Core
  • Dependencies
  • Extensions
  • Integrations
    • Spring IDE AJDT Integration
That's it! Finish the installation and restart RAD7. Now you should be able to add Spring Project Nature to your projects, view Bean Graphs, Web Flows, etc. Have Fun with it.