CAS (Central Authentication Service) is a single sign-on protocol for the web.
Its purpose is to permit a user to access multiple applications while providing their credentials
(such as user identifier and password) only once. It also allows Web applications to authenticate users
without gaining access to a user's security credentials, such as a password.
The name CAS also refers to a software package that implements this protocol.
This document presents the different operations to enable CAS with Silverpeas :
Installing the JDK
Installing a CAS Server on Tomcat
Enabling CAS Authentication on Silverpeas
For the rest of this document ServerA will be the CAS Server, and ServerB will be the Silverpeas Server.
You will install the latest JDK from SUN: download it from here.
It will be used by the Apache Tomcat server who will host the CAS server.
Certificates
To generate certificates for each server we will use the JDK tool: keytool.
The following command will create a keystore in C:\Java/keystore.jks:
Use the password changeit.
Enter all the requested information. Note that you must enter the name of the server as the 'first and last name'.
So for the CAS server it should be ServerA.
Now we need to repeat this operation for ServerB.
Trusting each others
Once the server is running, you can use our utility : Certificat Importer to add the certificate to the trustore.
Now we need to repeat this operation for ServerB.
Configuration of Tomcat as a CAS Server
Installing Tomcat
Download and install the last release of Tomcat from the Apache Tomcat website.
Don't forget to define the environment variables: JAVA_HOME and CATALINA_HOME.
Now, you can edit the file server.xml and allow the SSL connector by uncommenting
the following element and configuring the paths to the keystore an trustore :
Installing the CAS Server
Download the latest CAS Server package from the CAS Website.
Extract the WAR file from the archive in cas-server-3.4.2\modules and copy into in $CATALINA_HOME/webapps.
Rename the WAR into cas.war.
Configuring the authentication mecanism
The CAS Server is configured using the file deployerConfigContext.xml in the directory $CATALINA_HOME/webapps/cas/WEB-INF.
The previous example uses a connection to PostgreSQL (configure the datasource bean according to your RDBMS).
Don't forget to add the JDBC driver into your WEB-INF/lib directory.
You need to configure your LDAP parameters, and to download the Jar file cas-server-support-ldap
and add it to your WEB-INF/lib directory.
Customizing the CAS pages
You can customize les pages of the CAS Server by editing the JSPs in $CATALINA_HOME/webapps/cas/WEB-INF/view/jsp/default/ui
or the stylesheets in $CATALINA_HOME/webapps/cas/css.
Configuring Silverpeas
Configuring the keystore
On the Silverpeas Sever (ServerB). Go and edit the file $SILVERPEAS_HOME/initialize/systemSettings.properties.
Set the various parameters (supposing that the keystore you have generated following the documentation is in C:\Java\keystore.jks) :
javax.net.ssl.trustStore=C:\\Java\\keystore.jks
ssl.keystore=C:\\Java\\keystore.jks
ssl.keystore.password=changeit
Configuration the servlet filter
You need to enable the CAS Servlet Filter. To do this edit the $JBOSS_HOME/server/deploy/silverpeas.ear/war-ic.war/WEB-INF/web.xml.
and add the following configuration :
Edit the file in $SILVERPEAS_HOME/properties/org/silverpeas/lookAndFeel/generalLook.properties,
update the parameter loginPage like this :
Activating the realm
Edit the file in $SILVERPEAS_HOME/properties/org/silverpeas/authentication/autDomainSP.properties,
set the parameter autServer0.enabled to true and thus enable the CAS authentication :
Since the authentication was performed beforehand, the class AuthenticationCAS just check for an existing
user in the user table of Silverpeas.
Now we need to define the domainId that is going to be used by CAS. By default it is 0 to match the previous configuration but
this can be configured by editing the file in $SILVERPEAS_HOME/properties/org/silverpeas/authentication/settings/authenticationSettings.properties,
and add the following parameter like this :
At last, to coclude the configuration you can setup a logout page for Silverpeas to be called after the logout has been performed by adding the
entry logout.page to the file $SILVERPEAS_HOME/properties/org/silverpeas/authentication/settings/authenticationSettings.properties like this :