0

I am implementing a LDAP client to LDAP server which make a connection with the server and do authentication.What steps do I need to follow?

ShaAk
  • 190
  • 1
  • 12

1 Answers1

1

There are lot of options in UnboundID LDAP. You can use connection pool if you want and that will reduce extra load on LDAP server at the connection establishment.

To make the connection pool

try {
     connection = new LDAPConnection(address, port);
     BindResult bindResult = connection.bind(DN, password);
     connectionPool = new LDAPConnectionPool(connection, max_numbof_connection);     
} catch (LDAPException e) {
     String es = e.getExceptionMessage();
     System.out.println(es);
}

You can achieve this by making a single connection too. First you need to make an unauthenticated connection using address and port and then bind that connection using a DN and password. At the bind request you may find whether given DN is an authorized one or not.

Example for authenticate user from a connection without Connection pool

LDAPConnection connection = new LDAPConnection();
connection.connect("server.example.com", 389);
connection.bind("uid=john.doe,ou=People,dc=example,dc=com", "password"); 
Nikolai Shevchenko
  • 7,083
  • 8
  • 33
  • 42
Malinda
  • 336
  • 2
  • 12
  • Thank you the explanation. I was finding a good source to implement this. I will follow above answer and get back to you. Would you please find me a good source for this? – ShaAk Feb 28 '16 at 16:49