cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Barbara Slupik <barbara.slu...@ntlworld.com>
Subject Authentication block
Date Wed, 11 Jun 2008 14:36:35 GMT
Hello

I am trying to move my cocoon applications from cocoon-2.1.10 to  
cocoon-2.2.0. I cannot make the tomcat security (realm) work with  
cocoon-2.2.0 so I tried to use authentication block instead.

=== My application context ===

<bean name="org.apache.cocoon.auth.SecurityHandler/simple"
			class="org.apache.cocoon.auth.impl.SimpleSecurityHandler"
			scope="singleton">
	<property name="userProperties">
		<value>
			manager=mana
			manager.roles=admin_admin
			agent001=agen
			agent001.roles=admin_user
		</value>
	</property>
</bean>

<bean name="org.apache.cocoon.auth.Application/cocoon-app"
			class="org.apache.cocoon.auth.impl.StandardApplication"
			scope="singleton">
	<property name="securityHandler"  
ref="org.apache.cocoon.auth.SecurityHandler/simple"/>
</bean>

=== My sitemap ===

<map:match pattern="">
	<map:redirect-to uri="login"/>
</map:match>

<map:match pattern="home">
	<map:act type="cauth-is-logged-in">
		<map:parameter name="application" value="cocoon-app"/>
		<map:generate src="menu/home.xml"/>
		<map:transform type="role-filter"/>
		<map:transform type="i18n"><map:parameter name="locale"  
value="{request:locale}"/></map:transform>
		<map:serialize type="xhtml"/>
	</map:act>
	<map:redirect-to uri="login"/>
</map:match>

<map:match pattern="login">
	<map:act type="cauth-is-logged-in">
		<map:parameter name="application" value="cocoon-app"/>
		<map:redirect-to uri="home"/>
	</map:act>
	<map:generate src="menu/login.xml"/>
	<map:transform type="i18n"><map:parameter name="locale"  
value="{request:locale}"/></map:transform>
	<map:serialize type="xhtml"/>
</map:match>

<map:match pattern="j_security_check">
	<map:act type="cauth-login">
		<map:parameter name="application" value="cocoon-app" />
		<map:parameter name="name" value="{request-param:j_username}" />
		<map:parameter name="password" value="{request-param:j_password}" />
		<map:redirect-to uri="home" />
	</map:act>
	<map:redirect-to uri="error" />
</map:match>

  It looks like it logs in correctly, goes to home and displays menu/ 
home.xml, but the role-filter transformation can't see admin_admin role.

How to define roles in SimpleSecurityHandler? Are they recognised by  
role-filter transformer?
My users are in MySQL database. I use Hibernate. Should I use  
DAOSecurityHandler to get my users? How to use DAOSecurityHandler?

Best regards

Barbara

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message