Note | |
---|---|
In a production environment the CAS server should run on its own Tomcat instance but for purposes of this demonstration we will drop it in the same instance as Liferay Portal. |
Go to the server.xml file and uncomment the SSL section to open port 8443.
Save.
Download the
Liferay-portal-servicemix-4.2.0.war
file from
www.liferay/web/guest/downloads.
Rename the file to cas-web.war
.
Copy the war file and paste it to the Tomcat webapps directory.
To download the Yale CAS Client 2.0.11 go to http://www.ja-sig.org/products/cas/downloads/index.html.
Create a folder and extract the cas.client zip file into this folder.
Open the folder and navigate to the casclient jar file (cas-client-2.0.11\java\lib).
Copy the file.
Go to the lib file in Tomcat (webapps\ROOT\WEB_INF\lib) and paste the casclient jar file to replace the existing one.
In the command prompt go to the ROOT directory.
Enter the following:
keytool -genkey -alias tomcat -keypass changeit -keyalg RSA
Enter changeit for the password.
Anser the list of questions. Note that the first and last name must be the host name of your server and cannot be an IP address. This is very important because an IP address will fail client hostname verification even if it is correct.
Enter the following command to export he cert you generated from your personal keystore:
keytool -export -alias tomcat -keypass changeit -file server.cert
Enter changeit for the password.
Import the cert into Java's keystore with this command:
keytool -import -alias tomcat -file %FILE_NAME% -keypass changeit -keystore %JAVA_HOME%/jre/lib/security/cacerts
Enter changeit for the password.
Enter yes.
To set up Liferay Portal, navigate to the classes file in Tomcat (webapps\ROOT\WEB_INF\classes).
Create systemext.properties.
Open system-ext.properties and enter:
com.liferay.filters.sso.cas.CASFilter=true
Save.
Open portal-ext.properties and enter:
#auto.login.hooks=com.liferay.portal.security.auth.BasicAutoLogin auto.login.hooks=com.liferay.portal.security.auth.BasicAutoLogin,com.liferay.portal.security.auth.CASAutoLogin
Save.
Start Tomcat and go to Liferay Portal.
Click Sign In. If everything is set up correctly you will be redirected to the CAS server’s login screen.