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.
Requirements
- You need to have Java SDK v1.6 or greater.
- Servlet Containers like Tomcat , Websphere, JBoss etc.
- Apache Maven v3.0 or greater.
- Authentication technique related dependencies.
PROJECT = /home/ekiras/casand 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.xmlAdd the following code to the pom.
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd "> <modelVersion>4.0.0</modelVersion> <groupId>cas</groupId> <artifactId>ekiras</artifactId> <packaging>war</packaging> <version>1.0-SNAPSHOT</version> <build> <plugins> <plugin> <artifactId>maven-war-plugin</artifactId> <configuration> <warName>cas</warName> </configuration> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>org.jasig.cas</groupId> <artifactId>cas-server-webapp</artifactId> <version>${cas.version}</version> <type>war</type> <scope>runtime</scope> </dependency> </dependencies> <properties> <cas.version>4.0.0</cas.version> </properties> <repositories> <repository> <id>ja-sig</id> <url>http://oss.sonatype.org/content/repositories/releases/ </url> </repository> </repositories> </project>
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 commandmvn clean packageThis 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 |
CAS Successful Login screen |
CAS successful logout screen. |
How to Use Database for CAS Authentication.
No comments: