public final class LdapUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static DirContext |
bindUser(String strLDAPContext,
String strLDAPUrl,
String strDN,
String strPassword)
Connects an user to the ldap
|
static void |
freeContext(DirContext context)
Free the context
|
static DirContext |
getContext(String strLDAPContext,
String strLDAPUrl,
String strAdminDN,
String strAdminPassword)
Search LDAP context
|
static NamingEnumeration<SearchResult> |
searchUsers(DirContext context,
String strFilter,
String strUserDN,
String strDNBase,
SearchControls sc) |
public static DirContext getContext(String strLDAPContext, String strLDAPUrl, String strAdminDN, String strAdminPassword) throws NamingException
strLDAPContext - the ldap contextstrLDAPUrl - the ldap urlstrAdminDN - the admin dnstrAdminPassword - the admin passwordNamingException - in case of errorpublic static void freeContext(DirContext context) throws NamingException
context - the context to freeNamingException - in case of errorpublic static DirContext bindUser(String strLDAPContext, String strLDAPUrl, String strDN, String strPassword) throws NamingException
strLDAPContext - the ldap contextstrLDAPUrl - the ldap urlstrDN - the dnstrPassword - the passwordNamingException - in case of errorpublic static NamingEnumeration<SearchResult> searchUsers(DirContext context, String strFilter, String strUserDN, String strDNBase, SearchControls sc) throws NamingException
context - the ldap contextstrFilter - the filterstrUserDN - the user dnstrDNBase - the base dnsc - the search controlsNamingException - in case of errorCopyright © 2019 City of Paris. All rights reserved.