Spring Security: Authenticate user on LDAP without manager/admin user

26 03 2009

In my previou post on spring security with LDAP, I had used a manager/admin user to authenticate a user.

You can use the following code to authenticate the user directly, without manager/admin user:

<ldap-server id="ldapServer" url="ldap://ldapserver:port"/>

  <beans:bean id="bindAuthenticator" class="org.springframework.security.providers.ldap.authenticator.BindAuthenticator">
    <beans:constructor-arg ref="ldapServer" />
    <beans:property name="userDnPatterns">
      <beans:list>
        <beans:value>CN={0},ou=Users,dc=example,dc=com</beans:value>
      </beans:list>
    </beans:property>
  </beans:bean>

Actions

Information

Leave a comment