Hello,

I want to use LDAP server for CAS authentication.
But can't start CAS with LDAP authentication settings.

This is my environment:
  OS: Debian 5.0
  Apache-Tomcat: 6.0.18
  Apache-Ant: 1.7.1
  JDK: 6u13-linux-i586
  IP(example): 10.1.1.1
  LDAP Server IP(example): 10.1.1.2

This is my configuration refer to following document.
  URL: 
http://www.ja-sig.org/wiki/display/CASUM/CAS+Quickly+(LDAP%2C+Windows%2C+Apache+Directory+Server)

-----
- Install Java6 by aptitude
- Install Tomcat by binary package to /opt/tomcat
- Start tomcat and access http://10.1.1.1:8080/
  -> SUCCESS
- Install Ant by binary package to /opt/ant
- Get CAS binary package (cas-server-3.3.2-release.tar.gz)
- Extract and install CAS module (modules/cas-server-webapp-3.3.2.war)
  to /opt/tomcat/webapps
- Access http://10.1.1.1:8080/cas-server-webapp-3.3.2/login
  and login (Username: password, Password: password)
  -> SUCCESS
- Modify pom.xml

r...@debian5-vm:/opt/tomcat/webapps/cas-server-webapp-3.3.2/META-INF/maven/org.jasig.cas/cas-server-webapp#
 diff -ruN pom.xml.ORG
pom.xml
--- pom.xml.ORG 2009-04-11 11:16:26.000000000 +0900
+++ pom.xml     2009-05-25 17:00:10.000000000 +0900
@@ -85,6 +85,12 @@
                </dependency>

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

- Modify deployerConfigContext.xml

r...@debian5-vm:/opt/tomcat/webapps/cas-server-webapp-3.3.2/WEB-INF# diff -ruN 
deployerConfigContext.xml.ORG deployerConfigContext
.xml
--- deployerConfigContext.xml.ORG       2009-02-24 21:31:24.000000000 +0900
+++ deployerConfigContext.xml   2009-05-25 17:03:58.000000000 +0900
@@ -87,8 +87,11 @@
                                        | local authentication strategy.  You 
might accomplish this by coding a new such handler and declaring
                                        | 
edu.someschool.its.cas.MySpecialHandler here, or you might use one of the 
handlers provided in the adaptors modules.
                                        +-->
-                               <bean
-                                       
class="org.jasig.cas.authentication.handler.support.SimpleTestUsernamePasswordAuthenticationHandler"
 />
+<bean
+            
class="org.jasig.cas.adaptors.ldap.FastBindLdapAuthenticationHandler" >
+                                <property name="filter" value="XXXXXXXX" />
+                                <property name="contextSource" 
ref="contextSource" />
+            </bean>
                        </list>
                </property>
        </bean>
@@ -136,4 +139,25 @@
        <bean
                id="serviceRegistryDao"
                class="org.jasig.cas.services.InMemoryServiceRegistryDaoImpl" />
+
+<bean id="contextSource" 
class="org.jasig.cas.adaptors.ldap.util.AuthenticatedLdapContextSource">
+              <property name="pooled" value="true"/>
+              <property name="urls">
+                  <list>
+                      <value>ldap://10.1.1.2:389</value>
+                  </list>
+              </property>
+              <property name="userName" value="XXXXXXXX"/>
+              <property name="password" value="XXXXXXXX"/>
+              <property name="baseEnvironmentProperties">
+                  <map>
+                      <entry>
+                          <key>
+                              
<value>java.naming.security.authentication</value>
+                          </key>
+                          <value>simple</value>
+                      </entry>
+                  </map>
+              </property>
+        </bean>
 </beans>

- Copy cas-server-support-ldap-3.2.2.jar to WEB-INF/lib
- Access http://10.1.1.1:8080/manager/html/list and
  try to start CAS but fails. (status=false)
  Log message (/opt/tomcat/cas.log) is following.

2009-05-25 17:04:06,012 FATAL 
[org.jasig.cas.web.init.SafeContextLoaderListener] - SafeContextLoaderListener:
The Spring ContextLoaderListener we wrap threw on contextInitialized.
But for our having caught this error, the web application context would not 
have initialized.
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'centralAuthenticationService' defined in S
ervletContext resource [/WEB-INF/spring-configuration/applicationContext.xml]: 
Cannot resolve reference to bean 'authenticationMan
ager' while setting bean property 'authenticationManager'; nested exception is 
org.springframework.beans.factory.BeanCreationExcep
tion: Error creating bean with name 'authenticationManager' defined in 
ServletContext resource [/WEB-INF/deployerConfigContext.xml
]: Cannot create inner bean 
'org.jasig.cas.adaptors.ldap.FastBindLdapAuthenticationHandler#1a1569b' of type 
[org.jasig.cas.adaptor
s.ldap.FastBindLdapAuthenticationHandler] while setting bean property 
'authenticationHandlers' with key [1]; nested exception is o
rg.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'org.jasig.cas.adaptors.ldap.FastBindLdapAut
henticationHandler#1a1569b' defined in ServletContext resource 
[/WEB-INF/deployerConfigContext.xml]: Cannot resolve reference to b
ean 'contextSource' while setting bean property 'contextSource'; nested 
exception is org.springframework.beans.factory.CannotLoadB
eanClassException: Cannot find class 
[org.jasig.cas.adaptors.ldap.util.AuthenticatedLdapContextSource] for bean with 
name 'context
Source' defined in ServletContext resource 
[/WEB-INF/deployerConfigContext.xml]; nested exception is 
java.lang.ClassNotFoundExcept
ion: org.jasig.cas.adaptors.ldap.util.AuthenticatedLdapContextSource
...
snip
...
-----

Please tell me how to fix above error?

Best regards!

- flathill

-- 
You are currently subscribed to [email protected] as: 
[email protected]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user

Reply via email to