Java: Sample Active Directory authentication code
January 3, 2014 19 Comments
Here is a sample Java code to authenticate against Windows Active Directory server.
- The code finds all available active directory servers in your network.
- It uses one of the available active directory server for authentication.
- If an active directory server is down then it starts using next available server if any.
- This class is thread-safe, you can create one instance and re-use them multiple times.
- I tested this code from Linux and Windows box.
You can find the below source code in GitHub as well.
ActiveDirectoryAuthentication.java
Read more of this post