[cas-dev] CAS 3.1.1 rc2 + LDAP Authentication

Steeve s.chandi at ouestfrance-multimedia.com
Tue Oct 30 09:35:26 EDT 2007


Hello,

I'm in charge to deploy CAS in my company for a website develop with PHP5
and i have some trouble configuring LDAP with CAS.
I saw all the other post on that subject but unfortunately it still doesn't
work.
I'm new with cas and don't quite understand java too.

A help would be useful

I'm using the latest version of CAS on Linux.

Here's my error (pretty much common to other posts) :
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.CannotLoadBeanClassException: Error
loading class
[org.jasig.cas.adaptors.ldap.util.AuthenticatedLdapContextSource] for bean
with name 'contextSource' defined in ServletContext resource
[/WEB-INF/deployerConfigContext.xml]: problem with class file or dependent
class; nested exception is java.lang.NoClassDefFoundError:
org/jasig/cas/adaptors/ldap/util/AuthenticatedLdapContextSource :
net/sf/ldaptemplate/support/LdapContextSource
Caused by: java.lang.NoClassDefFoundError:
org/jasig/cas/adaptors/ldap/util/AuthenticatedLdapContextSource :
net/sf/ldaptemplate/support/LdapContextSource
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1650)
        at
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:856)
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1305)
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1187)
        at org.springframework.util.ClassUtils.forName(ClassUtils.java:177)
        at
org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:317)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1008)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.isBeanClassMatch(AbstractBeanFactory.java:1036)
        at
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:165)
        at
org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:689)
        at
org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:395)
        at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:328)
        at
org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
        at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
        at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
        at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
        at
org.jasig.cas.web.init.SafeContextLoaderListener.contextInitialized(SafeContextLoaderListener.java:62)
        at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3692)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4127)
        at
org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1175)
        at
org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:527)
        at
org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.java:104)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:514)

And here's my deployerConfigContext.xml file :

<?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="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="uid=%u" />
                  <property name="searchBase"
value="ou=utilisateurs,dc=ofmlan,dc=fr" />
                    <property name="contextSource" ref="contextSource" />
                                </bean>
                        </list>
                </property>
        </bean>
               
               
        <bean id="contextSource"
class="org.jasig.cas.adaptors.ldap.util.AuthenticatedLdapContextSource">
                 <property name="anonymousReadOnly" value="false" />
                 <property name="pooled" value="true" />
                 <property name="userName" value="" />
                 <property name="password" value="" />
                 <property name="urls">
                         <list>
                                 <value>ldap://ldap.ws.ofm.local/</value>
                         </list>
                 </property>
                 <property name="baseEnvironmentProperties">
                         <map>
                                 <entry>
                                        
<key><value>java.naming.security.authentication</value></key>
                                         <value>simple</value>
                                 </entry>
                        </map>
                </property>
        </bean>
</beans>


Thanks for your help. 
-- 
View this message in context: http://www.nabble.com/CAS-3.1.1-rc2-%2B-LDAP-Authentication-tf4717684.html#a13486120
Sent from the CAS Dev mailing list archive at Nabble.com.



More information about the cas-dev mailing list