Raible's Wiki

Raible Designs
Wiki Home
News
Recent Changes

AppFuse

Homepage
  - Korean
  - Chinese
  - Italian
  - Japanese

QuickStart Guide
  - Chinese
  - French
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish
  - Japanese

User Guide
  - Korean
  - Chinese

Tutorials
  - Chinese
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish

FAQ
  - Korean

Latest Downloads

Other Applications

Struts Resume
Security Example
Struts Menu

Set your name in
UserPreferences


Referenced by
AppFuseSecurity
AppFuseSecurityMetho...
AppFuseSecuritySetti...




JSPWiki v2.2.33

[RSS]


Hide Menu

AppFuseAuthentication


Difference between version 4 and version 3:

At line 12 changed 1 line.
* [5] Add an "enabled" variable to the User object
* [5] Add an "enabled" variable to the User object (optional)
At line 17 changed 1 line.
Download the following two JARs and put them in the lib/spring-1.1.3 directory of your project. If you're on an older version of Spring, that shouldn't matter. The Acegi Security JAR listed below contains a [patch|http://forum.springframework.org/viewtopic.php?p=10396#10396] that allows you to easily exclude URLs. Before the 1.8 release, I hope to fix this so you don't need a patched version.
Download the following two JARs and put them in the lib/spring-1.1.3 directory of your project. If you're on an older version of Spring, that shouldn't matter.
At line 19 changed 2 lines.
* [acegi-security-0.7-SNAPSHOT.jar|https://appfuse.dev.java.net/source/browse/appfuse/lib/spring-1.1.3/acegi-security-0.7-SNAPSHOT.jar?rev=1.1]
* [commons-codec.jar|https://appfuse.dev.java.net/source/browse/appfuse/lib/spring-1.1.3/commons-codec.jar?rev=1.1]
* [acegi-security-0.8.1-SNAPSHOT.jar|https://appfuse.dev.java.net/source/browse/appfuse/lib/spring-1.1.5/acegi-security-0.8.1-SNAPSHOT.jar]
* [commons-codec.jar|https://appfuse.dev.java.net/source/browse/appfuse/lib/spring-1.1.5/commons-codec.jar]
At line 23 changed 1 line.
Download [applicationContext-security.xml|https://appfuse.dev.java.net/source/browse/appfuse/web/WEB-INF/applicationContext-security.xml?rev=1.1] and put it in your web/WEB-INF directory. Make sure your metadata/web/web-settings.xml file loads this file as part of the ContextLoaderListener. For AppFuse 1.7+, this should look as follows:
Download [applicationContext-security.xml|https://appfuse.dev.java.net/source/browse/appfuse/web/WEB-INF/applicationContext-security.xml] and put it in your web/WEB-INF directory. Make sure your metadata/web/web-settings.xml file loads this file as part of the ContextLoaderListener. For AppFuse 1.7+, this should look as follows:
At line 32 changed 1 line.
Add Acegi Security's filters to the top of metadata/web/filters.xml:
Add Acegi Security's filter to the top of metadata/web/filters.xml:
At line 35 removed 8 lines.
<filter>
<filter-name>Acegi Authentication Processing Filter</filter-name>
<filter-class>net.sf.acegisecurity.util.FilterToBeanProxy</filter-class>
<init-param>
<param-name>targetClass</param-name>
<param-value>net.sf.acegisecurity.ui.webapp.AuthenticationProcessingFilter</param-value>
</init-param>
</filter>
At line 44 changed 5 lines.
<filter-name>acegiSessionFilter</filter-name>
<filter-class>net.sf.acegisecurity.ui.webapp.HttpSessionIntegrationFilter</filter-class>
</filter>
<filter>
<filter-name>Acegi HTTP Request Security Filter</filter-name>
<filter-name>securityFilter</filter-name>
At line 52 changed 1 line.
<param-value>net.sf.acegisecurity.intercept.web.SecurityEnforcementFilter</param-value>
<param-value>net.sf.acegisecurity.util.FilterChainProxy</param-value>
At line 55 removed 4 lines.
<filter>
<filter-name>acegiRemoteUserFilter</filter-name>
<filter-class>net.sf.acegisecurity.ui.wrapper.ContextHolderAwareRequestFilter</filter-class>
</filter>
At line 64 removed 6 lines.
<filter-mapping>
<filter-name>Acegi Authentication Processing Filter</filter-name>
<url-pattern>/j_security_check</url-pattern>
<!--dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher-->
</filter-mapping>
At line 71 changed 1 line.
<filter-name>acegiSessionFilter</filter-name>
<filter-name>securityFilter</filter-name>
At line 73 removed 2 lines.
<!--dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher-->
At line 76 removed 10 lines.
<filter-mapping>
<filter-name>Acegi HTTP Request Security Filter</filter-name>
<url-pattern>*.html</url-pattern>
<!--dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher-->
</filter-mapping>
<filter-mapping>
<filter-name>acegiRemoteUserFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
At line 95 changed 1 line.
In order to hook into Acegi Security without changing much code, I did have to add a "enabled" property to the User object. This affects several areas of an AppFuse application. You will need to modify your code in the following areas to handle this.
One nice feature in Acegi Security is the ability to enable/disable users. In order to use this feature, you'll have to add an "enabled" property to the User object. This affects several areas of an AppFuse application. You will need to modify your code in the following areas to handle this.

Back to AppFuseAuthentication, or to the Page History.