I have been fumbling around for two days trying to get CAS running with LDAP-AD 
integration.  I am hoping that it is a simple fix like enabling the java class 
in the pom.xml he is my config followed by the cas.log output (sorry for the 
verbosity):


<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans";
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
 xmlns:p="http://www.springframework.org/schema/p";
 xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd";>

    <bean id="contextSource" 
class="org.springframework.ldap.core.support.LdapContextSource">
        <property name="pooled" value="true"/>
        <property name="urls">
            <list>
                <value>ldap://dc01.domain.com:3268/</value>
            </list>
        </property>
        <property name="userDn" value="CN=ACCOUNT,DC=domain,DC=com"/>
        <property name="password" value="PASSWORD"/>
        <property name="baseEnvironmentProperties">
            <map>
                <entry>
                    <key>
                        <value>java.naming.security.authentication</value>
                    </key>
                    <value>simple</value>
                </entry>
            </map>
        </property>
    </bean>

    <bean id="authenticationManager" 
class="org.jasig.cas.authentication.AuthenticationManagerImpl">
        <property name="credentialsToPrincipalResolvers">
            <list>
                <bean 
class="org.jasig.cas.authentication.principal.UsernamePasswordCredentialsToPrincipalResolver"
 />
                <bean 
class="org.jasig.cas.authentication.principal.HttpBasedServiceCredentialsToPrincipalResolver"
 />
            </list>
        </property>

        <property name="authenticationHandlers">
            <list>
                <bean 
class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler"
                    p:httpClient-ref="httpClient" />
                <!--<bean 
class="org.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler">
                    <property name="filter" value="sAMAccountName=%u" />
                    <property name="searchBase" 
value="OU=Accounts,OU=Employees,DC=domain,DC=com" />
                    <property name="contextSource" ref="contextSource" />
                </bean>
                -->
                <bean 
class="org.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler">
                  <property name="filter" value="sAMAccountName=%u" />
                  <property name="searchBase" 
value="OU=Accounts,OU=Employees,DC=domain,DC=com" />
                  <property name="contextSource" ref="contextSource" />
                  <property name="ignorePartialResultException" value="yes" /> 
<!-- fix because of how AD returns results -->
                </bean>
            </list>
        </property>
    </bean>


<!-- from 
http://shibsp.ntu.ac.uk/confluence/display/SHIB2/Configure+CAS+Server+for+AD+Authentication
 -->

   <bean id="userDetailsService" 
class="org.springframework.security.userdetails.memory.InMemoryDaoImpl">
        <property name="userMap">
            <value>

          </value>
        </property>
    </bean>

 <!--    <bean id="attributeRepository" 
class="org.jasig.services.persondir.support.StubPersonAttributeDao">
        <property name="backingMap">
            <map>
                <entry key="uid" value="uid" />
            </map>
        </property>
    </bean>

    <bean id="serviceRegistryDao" 
class="org.jasig.cas.services.InMemoryServiceRegistryDaoImpl" />
-->

<!-- Default section from stock file follows -->

        <!--
        Bean that defines the attributes that a service may return.  This 
example uses the Stub/Mock version.  A real implementation
        may go against a database or LDAP server.  The id should remain 
"attributeRepository" though.
        -->
        <bean id="attributeRepository" 
class="org.jasig.services.persondir.support.StubPersonAttributeDao">
                <property name="backingMap">
                        <map>
                                <entry key="uid" value="uid" />
                                <entry key="eduPersonAffiliation" 
value="eduPersonAffiliation" />
                                <entry key="groupMembership" 
value="groupMembership" />
                        </map>
                </property>
        </bean>

        <!--
        Sample, in-memory data store for the ServiceRegistry. A real 
implementation
        would probably want to replace this with the JPA-backed ServiceRegistry 
DAO
        The name of this bean should remain "serviceRegistryDao".
        -->

        <bean id="serviceRegistryDao" 
class="org.jasig.cas.services.InMemoryServiceRegistryDaoImpl" />

</beans>



Cas.log output:


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 'scheduler' defined in ServletContext resource 
[/WEB-INF/spring-configuration/applicationContext.xml]: Invocation of init 
method failed; nested exception is 
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find 
class [org.springframework.security.userdetails.memory.InMemoryDaoImpl] for 
bean with name 'userDetailsService' defined in ServletContext resource 
[/WEB-INF/deployerConfigContext.xml]; nested exception is 
java.lang.ClassNotFoundException: 
org.springframework.security.userdetails.memory.InMemoryDaoImpl
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1403)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
        at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:545)
        at 
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:871)
        at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
        at 
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:272)
        at 
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:196)
        at 
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
        at 
org.jasig.cas.web.init.SafeContextLoaderListener.contextInitialized_aroundBody0(SafeContextLoaderListener.java:62)
        at 
org.jasig.cas.web.init.SafeContextLoaderListener.contextInitialized_aroundBody1$advice(SafeContextLoaderListener.java:44)
        at 
org.jasig.cas.web.init.SafeContextLoaderListener.contextInitialized(SafeContextLoaderListener.java:1)
        at 
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)
        at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4212)
        at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
        at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
        at 
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
        at 
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
        at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
        at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at 
org.apache.catalina.core.StandardService.start(StandardService.java:448)
        at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: 
Cannot find class 
[org.springframework.security.userdetails.memory.InMemoryDaoImpl] for bean with 
name 'userDetailsService' defined in ServletContext resource 
[/WEB-INF/deployerConfigContext.xml]; nested exception is 
java.lang.ClassNotFoundException: 
org.springframework.security.userdetails.memory.InMemoryDaoImpl
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1208)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:570)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1277)
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:303)
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:382)
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:376)
        at 
org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1109)
        at 
org.jasig.cas.util.AutowiringSchedulerFactoryBean.afterPropertiesSet(AutowiringSchedulerFactoryBean.java:31)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1400)
        ... 39 more
Caused by: java.lang.ClassNotFoundException: 
org.springframework.security.userdetails.memory.InMemoryDaoImpl
        at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
        at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1205)
        at org.springframework.util.ClassUtils.forName(ClassUtils.java:258)
        at 
org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:408)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1229)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1200)



Any help would be greatly appreciated
TIA,
Steve

-- 
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