public final class LdapUtil extends Object
Modifier and Type | Method and Description |
---|---|
static DirContext |
bindUser(String strLDAPContext,
String strLDAPUrl,
String strDN,
String strPassword) |
static void |
freeContext(DirContext context)
Close the context given in parameter
|
static DirContext |
getContext(String strLDAPContext,
String strLDAPUrl,
String strAdminDN,
String strAdminPassword)
LDAP Context search
|
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 contextstrLDAPUrl
- the urlstrAdminDN
- the admin dn to usestrAdminPassword
- the admin password to useNamingException
- in case of errorpublic static void freeContext(DirContext context) throws NamingException
context
- the LDAP context as a DirContext objectNamingException
- in case of errorpublic static DirContext bindUser(String strLDAPContext, String strLDAPUrl, String strDN, String strPassword) throws NamingException
strLDAPContext
- the contextstrLDAPUrl
- the urlstrDN
- the dn of the user to connectstrPassword
- the password of the user to connectNamingException
- in case of errorpublic static NamingEnumeration<SearchResult> searchUsers(DirContext context, String strFilter, String strUserDN, String strDNBase, SearchControls sc) throws NamingException
context
- the contextstrFilter
- the filter for the searchstrUserDN
- the user dnstrDNBase
- the base dnsc
- the SearchControlsNamingException
- in case of errorCopyright © 2020 City of Paris. All rights reserved.