CAS Quickly (LDAP, Windows, Apache Directory Server)

Table of Contents

This tutorial is to demonstrate how to get CAS up quickly in Windows -> and testing it works.

 Pre-requisites:

 1. Apache tomcat is installed and running

 2. Java(JDK) is installed.

Guide: 

1.    Download Apache directory server from http://directory.apache.org/

 Run the setup with all the defaults and test that the server is working on localhost (default is port 10389)

Alternatively you can test with telnet

(Start->Run->telnet)

In the telnet console, type open localhost 10389 -> if you get a screen that lets you type (Apache Directory is configured properly), close telnet if you get this screen

2.    Download the CAS installation and find the war file e.g. \cas-server-3.2.1\modules\cas-server-webapp-3.2.1.war

3.   Start the Tomcat server, and after it is started..add the war file (cas-server-webapp-3.2.1.war) to the webapps folder e.g.          C:\apache-tomcat-6.0.14\webapps\cas-server-webapp-3.2.1.war

Now that CAS is deployed you should have an unpacked directory in your webapps folder  e.g. C:\apache-tomcat-6.0.14\webapps\cas-server-webapp-3.2.1

4.     Stop the tomcat server

5.     Now you have to add the following to the pom.xml file in the META-INF folder (e.g. C:\apache-tomcat-6.0.14\webapps\cas-server-webapp-3.2.1\META-INF\maven\org.jasig.cas\cas-server-webapp)

<dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>cas-server-support-ldap</artifactId>
             <version>${project.version}</version>
        </dependency>


6.    Add the following to the  deployerConfigContext.xml file in the WEB-INF directory e.g. C:\apache-tomcat-6.0.14\webapps\cas-server-webapp-3.2.1\WEB-INF (Connects to the default Apache Directory Server configuration)

<bean id="contextSource" class="org.jasig.cas.adaptors.ldap.util.AuthenticatedLdapContextSource">

              <property name="pooled" value="true"/>

              <property name="urls">

                  <list>

                      <value>ldap://localhost:10389</value>

                  </list>

              </property>

              <property name="userName" value="uid=admin,ou=system"/>

              <property name="password" value="secret"/>

              <property name="baseEnvironmentProperties">

                  <map>

                      <entry>

                          <key>

                              <value>java.naming.security.authentication</value>

                          </key>

                          <value>simple</value>

                      </entry>

                  </map>

              </property>

        </bean>

7.      Add the corresponding AuthenticationHandler to the deployerConfigContext.xml file (Remove the SimpleAuthenticationHandler) and Add the following in it's place

<bean

            class="org.jasig.cas.adaptors.ldap.FastBindLdapAuthenticationHandler" >

                                <property name="filter" value="uid=%u,ou=system" />

                                <property name="contextSource" ref="contextSource" />

            </bean>

8.     Add the cas-server-support-ldap-3.2.1.jar from the CAS installation  \cas-server-3.2.1\modules to the webapplication library e.g.    C:\apache-tomcat-6.0.14\webapps\cas-server-webapp-3.2.1\WEB-INF\lib

9.    Start tomcat and log in with the username: admin, password: secret at the url http://localhost:8080/cas-server-webapp-3.2.1/login

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.