Bonjour a tous,

je souhaiterais coupler un annuaire LDAP avec ACEGI pour sécuriser une application.

adresse de mon LDAP : ldap://x.x.x.x:389/ou=people,dc=test,dc=fr

éléments de code de mon fichier de configuration 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
54
55
 
...
 
<beans>
 
<bean id="initialDirContextFactory" class="org.acegisecurity.ldap.DefaultInitialDirContextFactory">
	<constructor-arg value="ldap://x.x.x.x:389/ou=People,dc=test,dc=fr"/>
	<property name="managerDn"><value>cn=manager,ou=People,dc=aql,dc=fr</value></property>
	<property name="managerPassword"><value>secret</value></property>
</bean>
 
 
<bean id="userSearch" class="org.acegisecurity.ldap.search.FilterBasedLdapUserSearch">
  <constructor-arg index="0"><value></value></constructor-arg>
  <constructor-arg index="1"><value>(uid={0})</value></constructor-arg>
  <constructor-arg index="2"><ref local="initialDirContextFactory" /></constructor-arg>            
  <property name="searchSubtree"><value>true</value></property>            
</bean>            
 
 
<bean id="ldapAuthProvider" class="org.acegisecurity.providers.ldap.LdapAuthenticationProvider">
	<constructor-arg>
		<bean class="org.acegisecurity.providers.ldap.authenticator.BindAuthenticator">
			<constructor-arg><ref local="initialDirContextFactory"/></constructor-arg>
			<property name="userDnPatterns"><list><value>cn={0},ou=People</value></list></property>
		</bean>
	</constructor-arg>
	<constructor-arg>
		<bean class="org.acegisecurity.providers.ldap.populator.DefaultLdapAuthoritiesPopulator">
			<constructor-arg><ref local="initialDirContextFactory"/></constructor-arg>
			<constructor-arg><value>ou=People</value></constructor-arg>
			<property name="groupRoleAttribute"><value>initials</value></property>
		</bean>
	</constructor-arg>
</bean>
 
...
 
<bean id="authenticationManager" class="org.acegisecurity.providers.ProviderManager">
		<property name="providers">
			<list>
				<ref local="daoAuthenticationProvider"/>
				<ref local="ldapAuthProvider"/>
 
				<bean class="org.acegisecurity.providers.anonymous.AnonymousAuthenticationProvider">
					<property name="key" value="changeThis"/>
				</bean>
				<bean class="org.acegisecurity.providers.rememberme.RememberMeAuthenticationProvider">
					<property name="key" value="changeThis"/>
				</bean>
			</list>
		</property>
	</bean>
 
...
J'effectue mes tests avec l'application web fournie dans ACEGI qui sécurise les pages avec un login/password et un rôle.

Mon serveur Tomcat se lance bien, il n'y a pas d'erreurs au démarrage mais après, je n'arrive pas à saisir un login/password correct.
J'ai l'erreur suivante:

Your login attempt was not successful, try again.
Reason: Bad credentials


Je ne sais pas d'ou provient mon erreur, connexion au LDAP ? mauvaise structure du LDAP ? ...

Si quelqu'un voit le problème ou possède des éléments de solution, je suis preneur.
Je vous en remercie par avance,

cordialement,