|
Key
This line was removed.
This word was removed. This word was added.
This line was added.
|
Changes (4)
View Page Historyh1. How to customise Petals View to work with CAS ?
This section assumes that you have installed a CAS server accessible to the following URL : [https://myHost:8443/cas] server.
h2. Enable CAS authentication
By default, Petals View is setup configured to works with an embedded User Management system that allows to manage application users directly from the Petals View GUI. So, if you want to delegate authentication to a CAS system, the first thing you have to do is to disable the default authentication service and enable the CAS one.
{warning}Be careful, if you enable CAS authentication, the User Management system embedded in Petals View will be completly disabled. So the User Management section in the Petals View GUI will became useless. Authentication will be managed by the CAS server and user roles management will be externalised (see : {color:#ff0000}TODO{color}){warning}
Go to the Petals View web application directory in your application server web app repository. We call this directory *PETALSVIEW_ROOT*.
</beans>{code}
You also need to activate a CAS filter in the *PETALSVIEW_ROOT{*}*/WEB-INF/*{*}web.xml* file. Just uncomment the section :
{code:lang=xml}
<!-- Filter for Security -->
<filter>
<filter-name>CAS Single Sign Out Filter</filter-name>
<filter-class>org.jasig.cas.client.session.SingleSignOutFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>CAS Single Sign Out Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
{code}
h2. Configure CAS properties
Now you have to configure CAS properties in the *PETALSVIEW_ROOT{*}*/WEB-INF/*{*}petalsview.properties* file. Here is a sample configuration for a CAS server available at "https://localhost:8443/cas" and a Petals View instance available at{color:#000000} "{color}{color:#000000}http:{color}{color:#000000}//localhost:9080/petals-view-ui" :{color}
{code}## 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}
*cas.server.url* : your CAS server URL.
*cas.logout.path* : the path to the CAS server logout page. In the above example, the full path to the logout page is : {color:#000000}https:{color}{color:#000000}//localhost:8443/cas/logout.{color}
{color:#333333}{*}cas.login.path{*}{color} {color:#333333}: the path to the CAS server login page. In the above example, the full path to the login page is : {color}{color:#000000}https:{color}{color:#000000}//localhost:8443/cas/login.{color}
{color:#000000}{*}webapp.url{*}{color} {color:#000000}:{color} the URL to your Petals View webapp. This URL must be accessible from the CAS server as it will redicrect to this URL after authentication.
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.
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 CAS server, you could find it in the */WEB-INF/deployerConfigContext.xml* avalaible in the CAS server
\## 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