I'm using unboundid primitives to authenticate user from an android application on an Active Directory with the following code :
public boolean getConnection() {
LDAPConnection connection = new LDAPConnection();
try {
connection.connect("my.ldap.com", 389);
SearchResult searchResult = connection.search("XXX",SearchScope.SUB, "(uid="+username+")");
if(searchResult.getEntryCount() != 1) {
return false;
}
else {
String dn = searchResult.getSearchEntries().get(0).getDN();
try {
connection = new LDAPConnection("XXX", 389, dn, password);
return true;
}
catch (LDAPException e) {
return false;
}
}
} catch (LDAPException e) {
e.printStackTrace();
}
return true;
}
My question is : since the password is, in that function, clearely readable, do you know if and how it's encrypted to be "send" to the LDAP to be compared with the one in the AD ?