Customizing CAS - Central Authentication Service

After downloading CAS server from Jasig you will need to set it up in your environment for customization. Note that CAS is a maven based project.

Once in the CAS server folder you can type the following maven command to build all of CAS

mvn package install

To generate eclipse projects from the pom.xml run the following maven command from within the CAS server folder

mvn eclipse:eclipse

This will generate .project and .classpath files for all projects.

Decide which project needs modifying and import it into eclipse. Most of the time it will be cas-server-web project. Eclipse will complain if you don't also import cas-server-core and cas-server-support-ldap since these projects are dependencies for cas-server-web.

I would recommend to NOT copy the project in, but import the existing location. This will allow the directory to reflect any changes you make within Eclipse.

Since CAS uses the maven overlay method, create a new project along side of all of the CAS projects. I called mine local-cas. Create a pom.xml file and include the cas-server-webapp as a dependency. Include any of the other cas projects if you choose to use them. Your pom.xml file can should look similar to one below.

      <url><a href="http://developer.ja-sig.org/maven2/</url>
</a>    </repository>

If you want to use eclipse, then use the maven tool to create your Eclipse files for this local-cas project.

mvn eclipse:eclipse

The idea of the maven overlay is to recreate files already defined in a dependent war file. The files you create will simply replace the existing in the build process. If needing to switch to LDAP, then simply redefine the deployerConfigContext.xml accordingly. To modify the look and feel, create the jsp's in WEB-INF/view/jsp/mylookandfeel/. Next, redefine the file WEB-INF/classes/default_views.properties and redefine all of the jsp locations.

After creating all of these files, you can simply run the maven install command within the local-cas folder to create the war file

mvn package install

The war file can be dropped in any application container and used as a customized CAS install.

Post new comment

Subscribe to Syndicate