Bonjour,
j'ai essayé d'intégrer acegi avec ldap et pour cela j'ai utilisé une serveur ldap(OpenDS), et l'exemple qui est donné dans le site officiel d'acegi
voici mon fichier applicationContext-acegi-security-ldap.xml
Code XML : 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
 
<!--
  - Application context containing authentication, channel
  - security and web URI beans.
  -
  - Only used by "ldap" artifact.
  -
  - $Id: applicationContext-acegi-security.xml 1468 2006-05-20 17:50:51Z luke_t $
  -->
 
<beans>
 
   <!-- ======================== FILTER CHAIN ======================= -->
 
	<!--  if you wish to use channel security, add "channelProcessingFilter," in front
	      of "httpSessionContextIntegrationFilter" in the list below -->
   <bean id="filterChainProxy" class="org.acegisecurity.util.FilterChainProxy">
      <property name="filterInvocationDefinitionSource">
         <value>
        CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
        PATTERN_TYPE_APACHE_ANT
            /**=httpSessionContextIntegrationFilter,logoutFilter,authenticationProcessingFilter,exceptionTranslationFilter,filterInvocationInterceptor
         </value>
      </property>
   </bean>
 
   <!-- ======================== AUTHENTICATION ======================= -->
 
   <bean id="authenticationManager" class="org.acegisecurity.providers.ProviderManager">
      <property name="providers">
         <list>
            <ref local="ldapAuthenticationProvider"/>
         </list>
      </property>
   </bean>
 
   <bean id="initialDirContextFactory" class="org.acegisecurity.ldap.DefaultInitialDirContextFactory">
     <constructor-arg value="ldap://localhost:389/dc=exemple,dc=com"/>
     <property name="managerDn" value="cn=Directory Manager,dc=exemple,dc=com" />
     <property name="managerPassword" value="secret"/>
   </bean>
 
   <bean id="ldapAuthenticationProvider" 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>uid={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=groups</value></constructor-arg>
          <property name="groupRoleAttribute"><value>ou</value></property>
       </bean>
     </constructor-arg>
   </bean>
 
   <!-- Automatically receives AuthenticationEvent messages -->
   <bean id="loggerListener" class="org.acegisecurity.event.authentication.LoggerListener"/>
 
   <bean id="httpSessionContextIntegrationFilter" class="org.acegisecurity.context.HttpSessionContextIntegrationFilter">
   </bean>
 
   <bean id="logoutFilter" class="org.acegisecurity.ui.logout.LogoutFilter">
      <constructor-arg value="/index.jsp"/> <!-- URL redirected to after logout -->
      <constructor-arg>
         <list>
              <bean class="org.acegisecurity.ui.logout.SecurityContextLogoutHandler"/>
         </list>
      </constructor-arg>
   </bean>
 
 
   <!-- ===================== HTTP REQUEST SECURITY ==================== -->
 
   <bean id="exceptionTranslationFilter" class="org.acegisecurity.ui.ExceptionTranslationFilter">
      <property name="authenticationEntryPoint"><ref local="authenticationProcessingFilterEntryPoint"/></property>
   </bean>
 
   <bean id="authenticationProcessingFilter" class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilter">
      <property name="authenticationManager"><ref bean="authenticationManager"/></property>
      <property name="authenticationFailureUrl"><value>/acegilogin.jsp?login_error=1</value></property>
      <property name="defaultTargetUrl"><value>/</value></property>
      <property name="filterProcessesUrl"><value>/j_acegi_security_check</value></property>
   </bean>
 
   <bean id="authenticationProcessingFilterEntryPoint" class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint">
      <property name="loginFormUrl"><value>/acegilogin.jsp</value></property>
      <property name="forceHttps"><value>false</value></property>
   </bean>
 
   <bean id="httpRequestAccessDecisionManager" class="org.acegisecurity.vote.AffirmativeBased">
      <property name="allowIfAllAbstainDecisions"><value>false</value></property>
      <property name="decisionVoters">
         <list>
            <ref bean="roleVoter"/>
         </list>
      </property>
   </bean>
 
	<!-- Note the order that entries are placed against the objectDefinitionSource is critical.
	     The FilterSecurityInterceptor will work from the top of the list down to the FIRST pattern that matches the request URL.
	     Accordingly, you should place MOST SPECIFIC (ie a/b/c/d.*) expressions first, with LEAST SPECIFIC (ie a/.*) expressions last -->
	 <bean id="filterInvocationInterceptor" class="org.acegisecurity.intercept.web.FilterSecurityInterceptor">
    	<property name="authenticationManager"><ref local="authenticationManager"/></property>
    	<property name="accessDecisionManager"><ref local="httpRequestAccessDecisionManager"/></property>
      <property name="objectDefinitionSource">
			  <value>
			    CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
				\A/secure/super.*\Z=ROLE_WE_DONT_HAVE
				\A/secure/.*\Z=ROLE_SUPERVISOR,ROLE_TELLER
			  </value>
		  </property>
	 </bean>
 
	<!-- BASIC Regular Expression Syntax (for beginners):
 
	     \A means the start of the string (ie the beginning of the URL)
	     \Z means the end of the string (ie the end of the URL)
	     .  means any single character
	     *  means null or any number of repetitions of the last expression (so .* means zero or more characters)
 
	     Some examples:
 
	     Expression:   \A/my/directory/.*\Z
	     Would match:    /my/directory/
	                     /my/directory/hello.html
 
	     Expression:   \A/.*\Z
	     Would match:    /hello.html
	                     /
 
	     Expression:   \A/.*/secret.html\Z
	     Would match:    /some/directory/secret.html
	                     /another/secret.html
	     Not match:      /anothersecret.html (missing required /)
	-->
 
</beans>

et j'ai créé une entrer dans mon ldif uid="marissa" pass="koala"

mais j'ai toujours ce warning
[WARN,LoggerListener,http-8080-2] Authentication event AuthenticationFailureBadCredentialsEvent: marissa; details: org.acegisecurity.ui.WebAuthenticationDetails@fffdaa08: RemoteIpAddress: 127.0.0.1; SessionId: 504C044832ECF8CB31F13631AAB34BA3; exception: Bad credentials; nested exception is javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]