Here's what I've got working:
in my web.xml:
Code:
<!--
Configures the spring security filter.
-->
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>
org.springframework.web.filter.DelegatingFilterProxy
</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
in my security context:
Code:
<beans:bean id="userSearch"
class="org.springframework.security.ldap.search.FilterBasedLdapUserSearch">
<beans:constructor-arg index="0" value="${ldap.user-search-base}"/>
<beans:constructor-arg index="1" value="${ldap.user-search-filter}"/>
<beans:constructor-arg index="2" ref="contextSource" />
</beans:bean>
<beans:bean id="contextSource"
class="org.springframework.security.ldap.DefaultSpringSecurityContextSource">
<beans:constructor-arg value="${ldap.url}"/>
<beans:property name="userDn" value="${ldap.manager-dn}"/>
<beans:property name="password" value="${ldap.manager-password}"/>
</beans:bean>
<beans:bean id="ldapAuthProvider"
class="org.springframework.security.providers.ldap.LdapAuthenticationProvider">
<custom-authentication-provider/>
<beans:constructor-arg>
<beans:bean class="org.springframework.security.providers.ldap.authenticator.BindAuthenticator">
<beans:constructor-arg ref="contextSource"/>
<beans:property name="userSearch" ref="userSearch"/>
</beans:bean>
</beans:constructor-arg>
<beans:constructor-arg>
<!-- An authorities populator that loads roles as LDAP groups a user is a member of. -->
<beans:bean
class="org.springframework.security.ldap.populator.DefaultLdapAuthoritiesPopulator">
<beans:constructor-arg ref="contextSource"/>
<beans:constructor-arg value="${ldap.group-search-base}"/>
<beans:property name="groupSearchFilter" value="${ldap.group-search-filter}"/>
</beans:bean>
</beans:constructor-arg>
</beans:bean>
hope this helps.