salut,

je veux intégrer ldap avec cas-server-3.5.2

pour ce là j'ai essayé de suivre ces étapes :

1) dans deployerConfigContext.xml, j'ai ajouté quelques lignes :

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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<bean id="authenticationManager"
        class="org.jasig.cas.authentication.AuthenticationManagerImpl">
 
        <!-- Uncomment the metadata populator to allow clearpass to capture and cache the password
             This switch effectively will turn on clearpass.
        <property name="authenticationMetaDataPopulators">
           <list>
              <bean class="org.jasig.cas.extension.clearpass.CacheCredentialsMetaDataPopulator">
                 <constructor-arg index="0" ref="credentialsCache" />
              </bean>
           </list>
        </property>
         -->
 
        <!--
            | This is the List of CredentialToPrincipalResolvers that identify what Principal is trying to authenticate.
            | The AuthenticationManagerImpl considers them in order, finding a CredentialToPrincipalResolver which 
            | supports the presented credentials.
            |
            | AuthenticationManagerImpl uses these resolvers for two purposes.  First, it uses them to identify the Principal
            | attempting to authenticate to CAS /login .  In the default configuration, it is the DefaultCredentialsToPrincipalResolver
            | that fills this role.  If you are using some other kind of credentials than UsernamePasswordCredentials, you will need to replace
            | DefaultCredentialsToPrincipalResolver with a CredentialsToPrincipalResolver that supports the credentials you are
            | using.
            |
            | Second, AuthenticationManagerImpl uses these resolvers to identify a service requesting a proxy granting ticket. 
            | In the default configuration, it is the HttpBasedServiceCredentialsToPrincipalResolver that serves this purpose. 
            | You will need to change this list if you are identifying services by something more or other than their callback URL.
            +-->
        <property name="credentialsToPrincipalResolvers">
            <list>
                <!--
                    | UsernamePasswordCredentialsToPrincipalResolver supports the UsernamePasswordCredentials that we use for /login 
                    | by default and produces SimplePrincipal instances conveying the username from the credentials.
                    | 
                    | If you've changed your LoginFormAction to use credentials other than UsernamePasswordCredentials then you will also
                    | need to change this bean declaration (or add additional declarations) to declare a CredentialsToPrincipalResolver that supports the
                    | Credentials you are using.
                    +-->
                <!--<bean class="org.jasig.cas.authentication.principal.UsernamePasswordCredentialsToPrincipalResolver" >
                    <property name="attributeRepository" ref="attributeRepository" />
                </bean>-->
                <bean 
     class="org.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler"> 
     <property name="filter" value="uid=%u" /> 
     <property name="searchBase" value="DC=MINISTER,DC=FR" />  
     <property 
        name="contextSource" 
        ref="contextSource" /> 
    </bean> 
                <!--
                    | HttpBasedServiceCredentialsToPrincipalResolver supports HttpBasedCredentials.  It supports the CAS 2.0 approach of
                    | authenticating services by SSL callback, extracting the callback URL from the Credentials and representing it as a
                    | SimpleService identified by that callback URL.
                    |
                    | If you are representing services by something more or other than an HTTPS URL whereat they are able to
                    | receive a proxy callback, you will need to change this bean declaration (or add additional declarations).
                    +-->
                <bean
                    class="org.jasig.cas.authentication.principal.HttpBasedServiceCredentialsToPrincipalResolver" />
            </list>
        </property>
 
 
 
<!--
    Config CAS with LDAP
    -->
    <bean id="contextSource" class="org.jasig.cas.adaptors.ldap.util.AuthenticatedLdapContextSource"> 
 <property name="anonymousReadOnly" value="false" /> 
 <property name="pooled" value="true"/> 
 <property name="urls"> 
    <list> 
   <value>ldap://192.168.0.88:389/</value> 
 
    </list> 
 </property> 
 <property name="userDn" value="DC=MINISTER,DC=FR"/> 
 <property name="groupDn" value="DC=MINISTER,DC=FR"/> 
 <property name="password" value="userPassword"/> 
 <property name="baseEnvironmentProperties"> 
    <map> 
   <!--entry> 
            <key><value>java.naming.security.protocol</value></key> 
            <value>ssl</value> 
    </entry--> 
   <entry> 
    <key> 
     <value>java.naming.security.authentication</value> 
    </key> 
    <value>simple</value> 
   </entry> 
    </map> 
 </property> 
</bean>
2) dans pom.xml

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>
3) dans apache-tomcat-7.0.47\webapps\cas-server-webapp-3.5.2\WEB-INF\lib

cas-server-support-ldap-3.5.2.jar

mais quand j'ai essayé de démarrer cas server j'ai trouvé cette erreur :

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
     ... 
    Caused by: java.lang.NoClassDefFoundError: org/springframework/ldap/NamingSecuri
    tyException
            at java.lang.Class.getDeclaredConstructors0(Native Method)
            at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
            at java.lang.Class.getConstructor0(Class.java:2699)
            at java.lang.Class.getDeclaredConstructor(Class.java:1985)
            at org.springframework.beans.factory.support.SimpleInstantiationStrategy
    .instantiate(SimpleInstantiationStrategy.java:67)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    Factory.instantiateBean(AbstractAutowireCapableBeanFactory.java:990)
            ... 48 more
    Caused by: java.lang.ClassNotFoundException: org.springframework.ldap.NamingSecu
    rityException
            at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
    der.java:1702)
            at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
    der.java:1547)
            ... 54 more
    SafeContextLoaderListener:
    The Spring ContextLoaderListener we wrap threw on contextInitialized.
    But for our having caught this error, the web application context would not have
     initialized.
..........
pour les paramètres de ldap je veux utiliser les mêmes paramètres que j'ai déjà utiliser dans l’intégration de ldap avec liferay

voici les paramètres de ldap avec liferay


Base Provider URL
ldap://192.168.0.88:389


Base DN
DC=MINISTER,DC=FR

Principal
CN=LDAP Requester,OU=Users,OU=Technical Accounts,OU=P9 Accounts,DC=MINISTER,DC=FR

Credentials

minister$9999


Users

Authentication Search Filter
(&(objectClass=person)(mail=@email_address@))

Import Search Filter
(objectClass=person)

User Mapping

Screen Name
sAMAccountName

Password
userPassword

Email Address
mail

Full Name
cn

First Name
givenName

Middle Name
middleName

Last Name
sn

Group
memberOf

Groups

Import Search Filter
(&(objectClass=group)(|(cn=MinisterUsers)(cn=MinisterAdministrateurs)(cn=Minister_*)))

Group Mapping

Group Name
cn

Description
sAMAccountName

User
member


Export

Users DN
DC=MINISTER,DC=FR

Groups DN
DC=MINISTER,DC=FR



merci d'avance