You've probably sorted it out by now, but it sounds like you might do something with a extension to the DefaultSpringSecurityContextSource. We overrode ours to handle a different problem with the LDAP URL. We ended up with something like
Code:
<bean id="myContextSource" class="my.ContextSource">
<constructor-arg value="... (LDAP URL, or something appropriate)">
(property tags for userDn, password, same as Spring class)
</bean>
Then pass the bean ref as a constructor arg to your LDAP Authentication Provider's authenticator and authorities populator:
Code:
<bean id="ldapAuthProvider" class="...LdapAuthenticationProvider">
<sec:custom-authentication-provider/>
<constructor-arg>
<bean class="...BindAuthenticator">
<constructor-arg ref="myContextSource"/>
</bean>
</constructor-arg>
<constructor-arg>
<bean class="...DefaultLdapAuthoritiesPopulator">
<constructor-arg ref="myContextSource"/>
<constructor-arg value="cn=Groups"/>
</bean>
</constructor-arg>
</bean>
<bean id="authenticationManager" class="...ProviderManager">
<property name="providers">
<list> <ref local="ldapAuthProvider"/> </list>
</property>
</bean>
This is all put together with Spring Security 2.0.5.
HTH