2
我使用unboundid元到上用下面的代碼的Active Directory認證來自一個Android應用程序的用戶:使用UnboundID進行LDAP認證:哪種安全性?
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;
}
我的問題是:因爲密碼是,在功能,clearely可讀的,你知道是否以及如何將其加密爲「發送」到LDAP以便與AD中的進行比較?
謝謝你的回答!我將使用SSL連接。 – Derbie 2013-03-27 15:39:33