Announcement Announcement Module
No announcement yet.
Using user login to bind to LDAP Page Title Module
Move Remove Collapse
This topic is closed
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using user login to bind to LDAP


    NOTE - I am currently limited to spring security 2.0

    I'm relatively new to spring security so apologies if this is an obvious question.

    - Our LDAP Server does NOT support anonymous binding
    - I dont want to create a special "Manager" account for binding
    - Every user that can log into our application will have those same credentials give them readonly access to the LDAP (We have a company wide LDAP server)

    So I want to be able to use the user supplied ID / Password to bind to the LDAP server before doing a search in the LDAP server for that same user's roles.

    As far as I can tell I need to create a custom LdapAuthenticationProvider but I'm not having any luck so far, has anyone done anything like this before?

    Thanks in advance for any help

  • #2
    You just need to implement the AuthenticationProvider interface. The authenticate() method will be passed a UsernamePasswordAuthentication token from which you can extract the username and password. Then write the necessary LDAP code to make the bind call and load the user authorities.


    • #3
      I think I understand,

      if I override the authenticate method I could create a local extSource from the username / password.

      This new context source could then be used to create a thenticationProvider and ticator.BindAuthenticator which would then be used to perform the authentication.

      Is this the right way of going about this?