Search code examples
javaactive-directoryldapjndiopenldap

How to manually check username and password of ldap user


I found a java code to authenticate a user using LDAP. It first connects to the LDAP with a username and password. It then does a second level authentication to validate a user with his username and password. Below is the link of the code https://stackoverflow.com/a/6703425/4671258. Is there any way to test LDAP authentication manually? I am using jXplorer to test first level of authentication, that is to connect to the ldap server. But i don't know how to test the second level of authentication.


Solution

  • If you just want to test if bind / authentication works, just do it the same way as it in the first level.

    There should be no difference. The reason for the first level authentication is, that only authenticated users can search for all attributes, or see into specific ou's. So the user logging in, has to type only his username, not his ldap fqdn.

    Here are also some simple examples for LDAP authentication with java: http://docs.oracle.com/javase/jndi/tutorial/ldap/security/ldap.html