当我拥有的唯一参数是用户 ID 时,我正在尝试获取用户的 DN(可能不止一个)
如您所见,我也在使用 UnboundID LDap SDK:
public String getCustomerAdminDN(String uid)
{
String result =null;
String filter = "uid=" +uid;
try {
SearchResult searchResult = this.ldapConnection.search("",SearchScope.SUB,filter);
result = searchResult.getMatchedDN();
} catch (LDAPSearchException e) {
throw new RuntimeException("Error in the searching query :" + e.getMessage());
}
return result;
}
假设我的 uid 属于以下 DN
非常感谢