2 Replies Latest reply on Jun 7, 2005 4:12 PM by sandipan_s

    Active Directory configuration for loginmodule

    sandipan_s

      Hi,

      I am connecting to Active Directory[AD] for user authentication from my loginmodule. But users in our AD do not have fixed DN.

      EG.,
      One user has
      dn: CN=user1,OU=Automatic Updates,OU=Computer Accounts,DC=company,DC=com

      While second user has
      dn: CN=user2,CN=Computers,DC=company,DC=com

      The only way i could think of autenticating user is by using his user name and pasword while making request. if bind is successful then user authenticated.
      I am using DirContext for authentication
      DirContext dir = new InitialDirContext(props); [here props is properties]

      1. Can anyone tell me what i need todo if i dnt have fixed DN. Also, can you please share with me the ldap connection properties that needs to be set.

      2. Where do i have to specify the connection username and connection password.

      3. Can i specify filter condition while making request like the way we do in ldapsearch. If anyone can share there code - it will be helpful.

      Thanks