Authentication

Petals View External Authentication

Introduction

By default, Petals View is 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 REALM system or LDAP system or CAS system, you have to do configurations according to your needs.

Be careful, if you enable REALM, LDAP or CAS authentication, the User Management system embedded in Petals View will be completely disabled. So the User Management section in the Petals View GUI will become useless. Authentication will be managed by the REALM mode, LDAP server or CAS server and user roles management will be externalised

Go to the Petals View web application directory in your application server web app repository. We'll call it PETALSVIEW_ROOT in this page.

Available roles

To use an external authentication, you need to add some specific roles to the users to customize their Petals View access rights. Here is a list of available roles:

ROLE_FLOWREFMANAGER: allows the user to access to the Flow Referential management section.

ROLE_FLOWMANAGER: allows the user to access to the Flow instances management section.

You must add the role "ROLE_AUTH" to all users so that they're authorized to access the Petals View web application.

Authentication with REALM

web.xml configuration

You must edit the web.xml (in PETALSVIEW_ROOT/WEB-INF repository) file and change comments. Comment the "classical authentication" section and the line "/WEB-INF/spring/petals-view-security-classical.xml". Uncomment the "realm authentication" section.

An exemple web.xml is provided here:
Display code example

You must configure your server to add realm security.

Tomcat configuration

For Tomcat, you must edit context.xml (in PETALSVIEW_ROOT/META-INF/ repository). Uncomment "JAAS implementation" or "JNDI implementation for ldap" or "JDBC implementation" and change the configuration according to your need.

An exemple context.xml is provided here with JAAS implementation:
Display code example

Authentification with LDAP

web.xml configuration

You must edit the web.xml (in PETALSVIEW_ROOT/WEB-INF repository) file and change comments. Comment the line "/WEB-INF/spring/petals-view-security-classical.xml" and uncomment the line "/WEB-INF/spring/petals-view-security-ldap.xml".

An exemple web.xml is provided here:
Display code example

petals-view-security-ldap.xml configuration

Edit petals-view-security-ldap.xml (in PETALSVIEW_ROOT/WEB-INF/spring repository), and change configuration according to your need.

An example petals-view-security-ldap.xml is provided here:
Display code example

Authentification with CAS

Overview

CAS is an enterprise Single Sign-On solution for web services. Single Sign-On (SSO) means a better user experience when running a multitude of web services, each with it's own means of authentication. With a SSO solution, different web services may authenticate to one authorative source of trust, that the user needs to log in to, instead of requiring the end-user to log in into each separate service.

JA-SIG produces an enterprise-wide single sign on system known as CAS. Unlike other initiatives, JA-SIG's Central Authentication Service is open source, widely used, simple to understand, platform independent, and supports proxy capabilities. Petals View could be connected to a CAS server to provide single sign on.

Somewhere in your enterprise you will need to setup a CAS server. The CAS server is simply a standard WAR file, so there isn't anything difficult about setting up your server. Inside the WAR file you will customise the login and other single sign on pages displayed to users.

You can learn more about CAS at http://www.ja-sig.org/cas. You will also need to visit this site to download the CAS Server files.

web.xml configuration

You must edit the web.xml (in PETALSVIEW_ROOT/WEB-INF repository) file and change comments. Comment the line "/WEB-INF/spring/petals-view-security-classical.xml" and uncomment the line "/WEB-INF/spring/petals-view-security-cas.xml". Comment "classical authentication" section and uncomment "cas authentication" section.

An exemple web.xml is provided here :
Display code example

Configure CAS properties

Now you have to configure CAS properties in the PETALSVIEW_ROOT/WEB-INF/Classes/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 "http://localhost:9080/petals-view-ui":

## 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

cas.server.url: your CAS server URL.
cas.logout.path: the path to the CAS server logout page. In the above example, the full URL to the logout page is: https://localhost:8443/cas/logout.
cas.login.path: the path to the CAS server login page. In the above example, the full URL to the login page is https//localhost:8443/cas/login.
webapp.url: the URL to your Petals View webapp. This URL must be accessible from the CAS server as it will redirect to this URL after authentication.

petals-view-security-cas.xml configuration

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-cas.xml file. You have to change the bean called "myUserDetailsService" to point to your custom user detail service. Here is the code snippet showing the default user details service configuration provided by Petals View.

<bean id="myUserDetailsService"
		class="com.ebmwebsourcing.petalsview.util.FullAccessRightsUserDetailsService">
	<property name="rolesResource">
		<value>${role.list.file.url}</value>
	</property>
</bean>

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 your CAS server, you could find it in the /WEB-INF/deployerConfigContext.xml avalaible in the CAS server webapp directory.

Be careful, the Spring framework version used in CAS server is 2.5 which is different from the one used in Petals View. Some packages have changed, but you could easily retrieve equivalent classes.

Here is a simple In Memory user details service for Spring 2.5.x:

<bean id="userDetailsService" class="org.springframework.security.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> 

Here is the same user details service, but for Spring 3.0.x:

<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>
The password is set to "dummy" for the three user defined because it isn't used (password based authentication is done by the CAS server). Only role list for each users is useful.

In Memory user details service isn't for production purposes. Use LDAP, JDBC or something else to connect to your user repository in production environment.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.