Hi all,
Please excuse me for posting this here as AFAIK this is not an Acegi problem as such but it's really puzzling me.
I am trying to configure LdapAuthenticationProvider using the BindAuthenticator. I have managed to get it working using a DN that includes the CN of the user being authenticated:
However, what I really want to do is authenticate against the UID of the user, not the CN (so in the config above I just change cn={0} to uid={0}). But whenever I try this I get an AuthenticationException:Code:<bean id="initialDirContextFactory" class="org.acegisecurity.ldap.DefaultInitialDirContextFactory"> <constructor-arg value="ldap://my.ldap.server:389/o=psygrid,c=uk"/> </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>cn={0},ou=users</value> </list> </property> </bean> </constructor-arg> <constructor-arg> <bean class="org.psygrid.ldap.PsygridLdapAuthoritiesPopulator" /> </constructor-arg> </bean>
Anybody got any ideas? I've not got much experience with LDAP so am a bit stumped.Code:2007-01-08 12:12:11,325 [http-8080-Processor25] DEBUG org.acegisecurity.providers.ldap.authenticator.BindAuthenticator - Failed to bind as uid=myuser,ou=users,o=psygrid,c=uk: javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]


