CAS Authentication

compared with
Version 7 by Olivier Fabre
on Jun 04, 2010 14:55.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (8)

View Page History
h1. How to customize user access rights with a CAS authentication enabled ?

By default, Petals View CAS authentication manager is plugged with a user rights manager that provides all rights to all authenticated users. If you would like to customize this behavior, you need to configure an other user rights manager. This could be done in the *PETALSVIEW_ROOT{*}*/WEB-INF/spring/petals-view-security.xml* file. You have to change the bean called {color:#000000}"{color}{color:#000000}myUserDetailsService{color}{color:#000000}"{color} to point to your custom user detail service. Spring provides a lot of user details service implementations for different types of user rights repositories like LDAP, JDBC, etc. For more information about user details services see [http://static.springsource.org/spring-security/site/docs/3.0.x/reference/technical-overview.html#d4e758] .

Your CAS server is also based on a Spring framework, so if you want to use the same user details service as the one configured in the your CAS server, you could find it in the */WEB-INF/deployerConfigContext.xml* avalaible in the CAS server  server webapp directory.
{warning}Be careful, the Spring framework version used in CAS server is 2.5 which is different from the one used in Petals Master. Some packages have changed, but you could easily retrieve equivalent classes.{warning}
Here is a simple In Memory user details service for Spring 2.5.x :
{code:lang=xml}<bean id="userDetailsService" class="org.springframework.security.userdetails.memory.InMemoryDaoImpl">
<property name="userMap">
<value>
admin=dummy,ROLE_AUTH,ROLE_FLOWMANAGER,ROLE_FLOWREFMANAGER,ROLE_USERMANAGER
{code} refmanager=dummy,ROLE_AUTH,ROLE_FLOWREFMANAGER
\## CAS properties
cas.server.url = [https://localhost:8443/cas]
cas.logout.path = /logout
cas.login.path = /login
webapp.url = [http://localhost:9080/petals-view-ui]
{code} fluxmanager=dummy,ROLE_AUTH,ROLE_FLOWMANAGER
</value>
</property>
</bean> {code}
Here is the same user details service, but for Spring 3.0.x :
{code:lang=xml}<bean id="userDetailsService" class="org.springframework.security.core.userdetails.memory.InMemoryDaoImpl">
<property name="userMap">
<value>
admin=dummy,ROLE_AUTH,ROLE_FLOWMANAGER,ROLE_FLOWREFMANAGER,ROLE_USERMANAGER
refmanager=dummy,ROLE_AUTH,ROLE_FLOWREFMANAGER
fluxmanager=dummy,ROLE_AUTH,ROLE_FLOWMANAGER
</value>
</property>
</bean> {code}