Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Easiest way to use LDAP in Java (Eclipse)

I'm currently working on a small project where I have to use LDAP in Eclipse (for Active-Directory access). I want to get the Usernames, create a new user, delete a user.

I actually never worked with LDAP before and I had a few difficulties with finding a well explained step-by-step tutorial to start with. In addition it seems that every tutorial seems to use a different API (OpenLDAP, Apache Directory, UnboundID, Spring Framework ect.), which confuses me. Which API should I use?

I would be very thankful if you would have some hints on how to get started with LDAP.

like image 719
muffin Avatar asked Feb 12 '26 23:02

muffin


1 Answers

My personal choice was UnboindID which is far from perfect, but is more recent than the others, and at least not a dead project like spring-ldap. It certainly has some annoying problems, for example many classes in its API are final which is not particularly testing friendly, as you cannot easily create mocks of them.

However if I started a new project now, I would consider using ldaptive which is not another LDAP client implementation, just an API layer above a concrete implementation (provider) to which it delegates LDAP operations. It can work with many different providers, and seems to offer a much nicer API and good documentation.

like image 112
zagyi Avatar answered Feb 14 '26 12:02

zagyi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!