public class ActiveDirectory extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ActiveDirectory.User
Used to represent a User in Active Directory
|
Modifier and Type | Method and Description |
---|---|
static LdapContext |
getConnection(String username,
String password)
Used to authenticate a user given a username/password.
|
static LdapContext |
getConnection(String username,
String password,
String domainName)
Used to authenticate a user given a username/password and domain name.
|
static LdapContext |
getConnection(String username,
String password,
String domainName,
String serverName)
Used to authenticate a user given a username/password and domain name.
|
static ActiveDirectory.User |
getUser(String username,
LdapContext context)
Used to check whether a username is valid.
|
static ActiveDirectory.User[] |
getUsers(LdapContext context)
Returns a list of users in the domain.
|
public static LdapContext getConnection(String username, String password) throws CommunicationException, AuthenticationException
username
- password
- CommunicationException
AuthenticationException
public static LdapContext getConnection(String username, String password, String domainName) throws CommunicationException, AuthenticationException
username
- password
- domainName
- CommunicationException
AuthenticationException
public static LdapContext getConnection(String username, String password, String domainName, String serverName) throws CommunicationException, AuthenticationException
username
- password
- domainName
- serverName
- CommunicationException
AuthenticationException
public static ActiveDirectory.User getUser(String username, LdapContext context)
username
- A username to validate (e.g. "peter", "peter@acme.com",
or "ACME\peter").context
- public static ActiveDirectory.User[] getUsers(LdapContext context) throws NamingException
context
- NamingException
Copyright © 2015. All rights reserved.