Package com.ibm.di.api.authentication
Class LDAPAuthentication
- java.lang.Object
-
- com.ibm.di.api.authentication.LDAPAuthentication
-
- All Implemented Interfaces:
AuthenticationInterface
public class LDAPAuthentication extends java.lang.Object implements AuthenticationInterface
This class provides the capability of authentication against a LDAP server.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringAUTH_MAP_LDAP_PASSWORDThe name of the parameter used to specify the LDAP password used for the authentication.static java.lang.StringAUTH_MAP_LDAP_USERNAMEThe name of the parameter used to specify the user name to authenticate.static java.lang.StringINITCTXThis constant holds the name of the class used as initial context.static java.lang.StringPARAM_LDAP_ADMIN_DNThe name of the parameter used to specify the LDAP administrator's distinguished name.static java.lang.StringPARAM_LDAP_ADMIN_PWDThe name of the parameter used to specify the LDAP administrator's password.static java.lang.StringPARAM_LDAP_BINARY_ATTRIBUTESThe name of a configuration parameter.static java.lang.StringPARAM_LDAP_GROUP_SEARCHBASEThe name of a configuration parameter.static java.lang.StringPARAM_LDAP_GROUP_SUPPORTThe name of a configuration parameter.static java.lang.StringPARAM_LDAP_GROUPNAME_ATTRIBUTEThe name of a configuration parameter.static java.lang.StringPARAM_LDAP_HOST_NAMEThe name of the parameter used to specify the LDAP host name.static java.lang.StringPARAM_LDAP_MEMBERSHIP_ATTRIBUTEThe name of a configuration parameter.static java.lang.StringPARAM_LDAP_MEMBERSHIP_ATTRIBUTE_CONTENTThe name of a configuration parameter.static java.lang.StringPARAM_LDAP_PORTThe name of the parameter used to specify the LDAP port.static java.lang.StringPARAM_LDAP_SEARCH_BASEThe name of the parameter used to specify the LDAP search base.static java.lang.StringPARAM_LDAP_SSL_ENABLEDThe name of the parameter used to specify that SSL is enabled or not.static java.lang.StringPARAM_LDAP_USERID_ATTRIBUTEThe name of a configuration parameter.
-
Constructor Summary
Constructors Constructor Description LDAPAuthentication()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidauthenticate(java.lang.String aUserName, java.lang.String aPassword)This method authenticates the user specified by the passed arguments.voidauthenticate(java.util.Map<java.lang.String,java.lang.String> map)This method authenticates the user using the entries in the provided map.voidclose()Closes the initialized connection.java.lang.StringgetUserGroups()voidinitialize(java.util.Map<java.lang.String,java.lang.String> configMap)Initializes the parameters used for the connection with the LDAP server using the provided as parameter configuration map.
-
-
-
Field Detail
-
INITCTX
public static final java.lang.String INITCTX
This constant holds the name of the class used as initial context.- See Also:
- Constant Field Values
-
PARAM_LDAP_HOST_NAME
public static final java.lang.String PARAM_LDAP_HOST_NAME
The name of the parameter used to specify the LDAP host name.- See Also:
- Constant Field Values
-
PARAM_LDAP_PORT
public static final java.lang.String PARAM_LDAP_PORT
The name of the parameter used to specify the LDAP port.- See Also:
- Constant Field Values
-
PARAM_LDAP_ADMIN_DN
public static final java.lang.String PARAM_LDAP_ADMIN_DN
The name of the parameter used to specify the LDAP administrator's distinguished name.- See Also:
- Constant Field Values
-
PARAM_LDAP_ADMIN_PWD
public static final java.lang.String PARAM_LDAP_ADMIN_PWD
The name of the parameter used to specify the LDAP administrator's password.- See Also:
- Constant Field Values
-
PARAM_LDAP_SEARCH_BASE
public static final java.lang.String PARAM_LDAP_SEARCH_BASE
The name of the parameter used to specify the LDAP search base.- See Also:
- Constant Field Values
-
PARAM_LDAP_USERID_ATTRIBUTE
public static final java.lang.String PARAM_LDAP_USERID_ATTRIBUTE
The name of a configuration parameter.- See Also:
- Constant Field Values
-
PARAM_LDAP_SSL_ENABLED
public static final java.lang.String PARAM_LDAP_SSL_ENABLED
The name of the parameter used to specify that SSL is enabled or not.- See Also:
- Constant Field Values
-
PARAM_LDAP_GROUP_SUPPORT
public static final java.lang.String PARAM_LDAP_GROUP_SUPPORT
The name of a configuration parameter.- See Also:
- Constant Field Values
-
PARAM_LDAP_MEMBERSHIP_ATTRIBUTE
public static final java.lang.String PARAM_LDAP_MEMBERSHIP_ATTRIBUTE
The name of a configuration parameter.- See Also:
- Constant Field Values
-
PARAM_LDAP_MEMBERSHIP_ATTRIBUTE_CONTENT
public static final java.lang.String PARAM_LDAP_MEMBERSHIP_ATTRIBUTE_CONTENT
The name of a configuration parameter.- See Also:
- Constant Field Values
-
PARAM_LDAP_GROUPNAME_ATTRIBUTE
public static final java.lang.String PARAM_LDAP_GROUPNAME_ATTRIBUTE
The name of a configuration parameter.- See Also:
- Constant Field Values
-
PARAM_LDAP_GROUP_SEARCHBASE
public static final java.lang.String PARAM_LDAP_GROUP_SEARCHBASE
The name of a configuration parameter.- See Also:
- Constant Field Values
-
PARAM_LDAP_BINARY_ATTRIBUTES
public static final java.lang.String PARAM_LDAP_BINARY_ATTRIBUTES
The name of a configuration parameter.- See Also:
- Constant Field Values
-
AUTH_MAP_LDAP_USERNAME
public static final java.lang.String AUTH_MAP_LDAP_USERNAME
The name of the parameter used to specify the user name to authenticate.- See Also:
- Constant Field Values
-
AUTH_MAP_LDAP_PASSWORD
public static final java.lang.String AUTH_MAP_LDAP_PASSWORD
The name of the parameter used to specify the LDAP password used for the authentication.- See Also:
- Constant Field Values
-
-
Method Detail
-
initialize
public void initialize(java.util.Map<java.lang.String,java.lang.String> configMap) throws java.lang.ExceptionInitializes the parameters used for the connection with the LDAP server using the provided as parameter configuration map.- Specified by:
initializein interfaceAuthenticationInterface- Parameters:
configMap- the configuration held in a map.- Throws:
java.lang.Exception- if the initialization fails.
-
authenticate
public void authenticate(java.util.Map<java.lang.String,java.lang.String> map) throws java.lang.ExceptionThis method authenticates the user using the entries in the provided map.- Specified by:
authenticatein interfaceAuthenticationInterface- Parameters:
map- the map containing the credentials used for the authentication.- Throws:
java.lang.Exception- if the authentication fails.- See Also:
AUTH_MAP_LDAP_USERNAME,AUTH_MAP_LDAP_PASSWORD
-
authenticate
public void authenticate(java.lang.String aUserName, java.lang.String aPassword) throws java.lang.ExceptionThis method authenticates the user specified by the passed arguments.- Specified by:
authenticatein interfaceAuthenticationInterface- Parameters:
aUserName- this is the user that will be authenticated.aPassword- this is the password used for the authentication.- Throws:
java.lang.Exception- if the authentication fails.
-
close
public void close() throws java.lang.ExceptionCloses the initialized connection.- Specified by:
closein interfaceAuthenticationInterface- Throws:
java.lang.Exception- if an error occurs.
-
getUserGroups
public java.lang.String getUserGroups()
- Returns:
- String object containing the LDAP groups, which the authenticating user is member of .
- Since:
- 7.0
-
-