If at this point you are not sure of exactly what LDAP is, I recommend this post which provides an excellent definition with examples. (In a nutshell it helps to think of an LDAP server as a specialised database).
Installing an LDAP Server
I'm running on a MBP. After looking around for a while I found that the easiest LDAP Server to install was ApacheDirectory which you can download from here. (To install and start the server should take less than 5 minutes)
Once it's installed it automatically starts the daemon. You can then run the server with this command.
sudo launchctl start org.apache.directory.server
For further installation instructions see here.
(If you need to uninstall you will find the application installed at /usr/local/apacheds-2.0.0-M20 just delete that directory and it will be gone)
LDAP Client
You will want to view the contents of your LDAP Server. The easiest LDAP client to install is Apache Directory Studio which can be downloaded from here.
Once it is downloaded you need to create a connection to the server - the instructions for which are contained here.
When connected your Apache Directory Studio should look something like this:
Now to access LDAP from a Java program. The best way to show you how to do this is through an example program. The program will perform the following tasks:
- Create an new LDAP object
- View an LDAP object
- Add a new attribute to an LDAP object
- Modify an attribute on an LDAP object
- Remove an attribute on an LDAP object
- Delete an LDAP object
- Search for all LDAP objects in a specific domain
Note: This class cleans up after itself i.e. It leaves the LDAP Server in the state in which it was found. If you want to see the various tasks in action just run one of the tasks and take a look at the LDAP Object through the LDAP Client. Don't forget you can modify the object in the LDAP Client and test in that way.
The code is below and should be self explanatory.
This helped a lot, thanks! You saved me at least a few hours poking around trying to figure it out myself :)
ReplyDelete- Fred
Thank you for this informative post!
ReplyDeleteExcellent work, keepup
ReplyDelete
ReplyDeleteExcellent blog. Looking for software courses?
DOT NET Training in Chennai
Hadoop Training in Chennai
Android Training in Chennai
Selenium Training in Chennai
JAVA Training in Chennai
German Classes in chennai
web designing course in chennai
web designing training in chennai
I visit your blogs and get updated with the information you include but today’s blog would be the most appreciable...
ReplyDeleteThanks
Cpa offers
This is very good blog to getting a knowledge.
ReplyDeleteweb designing and development course training institute in Chennai with placement
PHP MySQL programming developer course training institute in chennai with placement
Magento 2 Developer course training institute in chennai
It’s amazing in support of me to truly have a web site that is valuable meant for my knowledge. good luck.
ReplyDeleteAi & Artificial Intelligence Course in Chennai
PHP Training in Chennai
Ethical Hacking Course in Chennai Blue Prism Training in Chennai
UiPath Training in Chennai
Đặt vé tại phòng vé Aivivu, tham khảo
ReplyDeletevé máy bay đi Mỹ Vietnam Airline
vé máy bay vinh đi hồ chí minh
vé máy bay đà nẵng đi hà nội
vé máy bay đi đà lạt khứ hồi
vé máy bay đi Huế bao nhiêu
xe đưa rước sân bay
This comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDelete