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