use of com.zimbra.cs.ldap.LdapServerConfig.ExternalLdapConfig in project zm-mailbox by Zimbra.
the class AutoProvision method getExternalAttrsByDn.
protected ZAttributes getExternalAttrsByDn(String dn) throws ServiceException {
String url = domain.getAutoProvLdapURL();
boolean wantStartTLS = domain.isAutoProvLdapStartTlsEnabled();
String adminDN = domain.getAutoProvLdapAdminBindDn();
String adminPassword = domain.getAutoProvLdapAdminBindPassword();
ExternalLdapConfig config = new ExternalLdapConfig(url, wantStartTLS, null, adminDN, adminPassword, null, "auto provision account");
ZLdapContext zlc = null;
try {
zlc = LdapClient.getExternalContext(config, LdapUsage.AUTO_PROVISION);
return prov.getHelper().getAttributes(zlc, dn, getAttrsToFetch());
} finally {
LdapClient.closeContext(zlc);
}
}
Aggregations