How to setup and configure CAS - Central Authentication Service
Points To Remember
  • CAS works on Maven WAR overlay technique.
  • You need to create a SSL certificate to use CAS and run it over https to enable SSO(single sign on). How to create a SSL certificate and add it to keystore.
  • You can use LDAP, Database and Active Directory techniques to authenticate the user.
  1. You need to have Java SDK v1.6 or greater.
  2. Servlet Containers like Tomcat , Websphere, JBoss etc. 
  3. Apache Maven v3.0 or greater.
  4. Authentication technique related dependencies.
For the sake of simplicity let us assume that out application path is
PROJECT = /home/ekiras/cas
and our tomcat path is
TOMCAT = /home/ekiras/apache

Step 1 : Create pom.xml
You need to create a pom.xml to create the war file and package it. lets create the pom file in the project directory i.e. PROJECT/pom.xml
Add the following code to the pom.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns=""
         xsi:schemaLocation=" ">
                  <url> </url>
Here we have added the dependencies of the project and the repositories where it will look for the dependencies and jars. We are setting up CAS version 4.0.0
Step 2 : Lets check our progress
Let us check our progress and see if we have not missed on something. Run the following command
mvn clean package
This will create a war file in the directory PROJECT/target/. Deploy this war file on tomcat as instructed here. Now run the app you will see the screen like the following.
CAS login screen
You can now login to the CAS server using username="casuser" and password="Mellon". These are the default username password that can be used to login. After login you will see the screen like the following.
CAS Successful Login screen
We can logout the cas server using the path /logout. This will log out the user.
CAS successful logout screen.
So, we have now setup our CAS server and successfully logged into and logged out of  the CAS server.

How to Use Database for CAS Authentication.

No comments :

Post a Comment