[jboss-user] [JBoss Portal] - Portal Authentication with Acegi

engela do-not-reply at jboss.com
Fri Mar 16 07:24:29 EDT 2007


I have managed to use Acegi Security for Authentication:

Portal Authentication with Acegi

To use Acegi Security for authentication open the login-config.xml in JBOSS_HOME\server\default\deploy\jboss-portal.sar\config. Change the flag of org.jboss.portal.identity.auth.IdentityLoginModule to ?sufficient? and add new login-module configuration using the org.acegisecurity.adapters.jboss.JbossAcegiLoginModule Login Module.

<application-policy name="portal">
  |       <authentication>
  |          <login-module code="org.jboss.portal.identity.auth.IdentityLoginModule" flag="sufficient">
  |             <module-option name="unauthenticatedIdentity">guest</module-option>
  |             <module-option name="userModuleJNDIName">java:/portal/UserModule</module-option>
  |             <module-option name="roleModuleJNDIName">java:/portal/RoleModule</module-option>
  |             <module-option name="additionalRole">Authenticated</module-option>
  |             <module-option name="password-stacking">useFirstPass</module-option>
  |          </login-module>
  | 		
  | 		<login-module code = "org.acegisecurity.adapters.jboss.JbossAcegiLoginModule"
  |         	flag = "required">
  |         	<module-option name = "appContextLocation">acegisecurity.xml</module-option>
  |         	<module-option name = "key">my_password</module-option>
  |      	</login-module>	
  |       </authentication>
  |    </application-policy>
The value in the "appContextLocation" is the name of the the acegi security configuration file e.g. in the example acegisecurity.xml. Copy the acegi security configuration file to the directory:

JBOSS_HOME\server\default\deploy\jboss-portal.sar\portal-server.war\WEB-INF

The acegi configuration file contains the spring context definition including all the authentication manager beans (For more information consult the Acegi Security documentation). For Portal Authentication it is sufficient to define the authentication manager.


<?xml version="1.0" encoding="UTF-8"?>
  | <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
  | 
  | <beans>
  | 	
  | 	<bean id="authenticationManager"
  | 		class="org.acegisecurity.providers.ProviderManager">
  | 		<property name="providers">
  | 			<list>
  | 				<ref bean="daoAuthenticationProvider" />
  | 			</list>
  | 		</property>
  | 	</bean>
  | 
  | 
  | 	<bean id="daoAuthenticationProvider"
  | 		class="org.acegisecurity.providers.dao.DaoAuthenticationProvider">
  | 		<property name="userDetailsService" ref="userDetailsService" />
  | 	</bean>
  | 
  | 	<bean id="userDetailsService"
  | 		class="org.acegisecurity.userdetails.memory.InMemoryDaoImpl">
  | 		<property name="userMap">
  | 			<value>
  | 				myadmin=myadmin,Admin,Authenticated,
  | 				myuser=mysuser,User,Authenticated
  | 			</value>
  | 		</property>
  | 	</bean>
  | 
  | </beans>
Another approach is to use the second approach is to use Spring singleton capabilities for more information see: http://sun.calstatela.edu/~cysun/documentation/acegi/acegi.html#ca-jboss

My next step will be to use Acegi Security within Portlets. Has anyone experience with this?

Best Regards,

Anette


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4028742#4028742

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4028742



More information about the jboss-user mailing list