salut,

je veux intégrer ldap avec cas server

mais lors de test j'ai cette erreur :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
Caused by: java.lang.ClassNotFoundException: org.jasig.cas.adaptors.ldap.util.Au
thenticatedLdapContextSource
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1702)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1547)
        at org.springframework.util.ClassUtils.forName(ClassUtils.java:258)
        at org.springframework.beans.factory.support.AbstractBeanDefinition.reso
lveBeanClass(AbstractBeanDefinition.java:417)
j'ai ajouté cas-server-support-ldap-3.5.2.jar et spring-ldap-1.3.1.RELEASE-all.jar dans apache-tomcat-7.0.47\webapps\cas-server-webapp-3.5.2\WEB-INF\lib


et j'ai ajouté :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
<dependency> 
   <groupId>org.jasig.cas</groupId> 
   <artifactId>cas-server-support-ldap</artifactId> 
   <version>3.5.2</version> 
</dependency>
dans apache-tomcat-7.0.47\webapps\cas-server-webapp-3.5.2\META-INF\maven\org.jasig.cas\cas-server-webapp\pom.xml

et j'ai ajouté dans deployerConfigContext.xml:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<bean id="authenticationManager"
        class="org.jasig.cas.authentication.AuthenticationManagerImpl">
            <property name="credentialsToPrincipalResolvers">
            <list>
 
                <bean class="org.jasig.cas.authentication.principal.UsernamePasswordCredentialsToPrincipalResolver" >
                    <property name="attributeRepository" ref="attributeRepository" />
                </bean>
 
                <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="cn=%u" />
         <property name="searchBase" value="OU=Users,OU=User Accounts,DC=MIN,DC=FR" />
         <property name="contextSource" ref="contextSource" />
         <property name="ignorePartialResultException" value="yes" />
        </bean>
            </list>
        </property>
    </bean>
 
 <bean id="contextSource" class="org.jasig.cas.adaptors.ldap.util.AuthenticatedLdapContextSource">
    <property name="urls">
      <list>
       <value>ldap://192.168.0.88:389</value>
      </list>
   </property>
 
   <property name="userName"
      value="CN=LDAP Requester,OU=Users,OU=Technical Accounts,DC=MIN,DC=FR"/>
   <property name="password" value="min$2013"/>
   <property name="baseEnvironmentProperties">
    <map>
     <entry>
       <key>
        <value>java.naming.security.authentication</value>
       </key>
       <value>simple</value>
     </entry>
    </map>
   </property>
  </bean>