0

I am trying to make a LDAP connection. I am using apache directory api. I am using the following code:

LdapConnection connection = new LdapNetworkConenction("serverAddress",port);
connection.bind(DN,password);

Here instead of the DN i want to use the domain/username to bind to the directory service. 'When using the apache ds i am able to connect and authenticate via domain/username and not require the DN.

How can i do this using the apache directory api.

1 Answers1

1

You have to first bind as the application, search the directory for the DN corresponding to the username, and then bind using that DN.

user207421
  • 305,947
  • 44
  • 307
  • 483
  • I think you mean to say make an anonymous bind and then search for the user DN using the filter? It doesnt return any result that way. But same search gives correct result when i bind using the DN. – Abhishek Rawat Apr 29 '15 at 11:54
  • http://stackoverflow.com/questions/2172831/how-do-a-ldap-search-authenticate-against-this-ldap-in-java this link helps – Abhishek Rawat Apr 29 '15 at 12:23