Package org.ldaptive.auth
Class AbstractAuthenticationHandler
java.lang.Object
org.ldaptive.auth.AbstractAuthenticationHandler
- All Implemented Interfaces:
AuthenticationHandler
,ConnectionFactoryManager
- Direct Known Subclasses:
CompareAuthenticationHandler
,SimpleBindAuthenticationHandler
public abstract class AbstractAuthenticationHandler
extends Object
implements AuthenticationHandler, ConnectionFactoryManager
Base class for an LDAP authentication implementations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate RequestControl[]
controls used by this handler.private ConnectionFactory
Connection factory.protected final org.slf4j.Logger
Logger for this class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionPerform an ldap authentication.protected abstract AuthenticationHandlerResponse
authenticateInternal
(Connection c, AuthenticationCriteria criteria) Authenticate on the supplied connection using the supplied criteria.Returns the controls for this authentication handler.Returns the connection factory.protected RequestControl[]
processRequestControls
(AuthenticationCriteria criteria) Combines request controls in theAuthenticationRequest
withauthenticationControls
.void
setAuthenticationControls
(RequestControl... cntrls) Sets the controls for this authentication handler.void
Sets the connection factory.
-
Field Details
-
logger
protected final org.slf4j.Logger loggerLogger for this class. -
factory
Connection factory. -
authenticationControls
controls used by this handler.
-
-
Constructor Details
-
AbstractAuthenticationHandler
public AbstractAuthenticationHandler()
-
-
Method Details
-
getConnectionFactory
Description copied from interface:ConnectionFactoryManager
Returns the connection factory.- Specified by:
getConnectionFactory
in interfaceConnectionFactoryManager
- Returns:
- connection factory
-
setConnectionFactory
Description copied from interface:ConnectionFactoryManager
Sets the connection factory.- Specified by:
setConnectionFactory
in interfaceConnectionFactoryManager
- Parameters:
cf
- connection factory
-
getAuthenticationControls
Returns the controls for this authentication handler.- Returns:
- controls
-
setAuthenticationControls
Sets the controls for this authentication handler.- Parameters:
cntrls
- controls to set
-
authenticate
Description copied from interface:AuthenticationHandler
Perform an ldap authentication.- Specified by:
authenticate
in interfaceAuthenticationHandler
- Parameters:
ac
- to perform the authentication with- Returns:
- authentication handler response
- Throws:
LdapException
- if ldap operation fails
-
authenticateInternal
protected abstract AuthenticationHandlerResponse authenticateInternal(Connection c, AuthenticationCriteria criteria) throws LdapException Authenticate on the supplied connection using the supplied criteria.- Parameters:
c
- to authenticate oncriteria
- criteria to authenticate with- Returns:
- authentication handler response
- Throws:
LdapException
- if the authentication fails
-
processRequestControls
Combines request controls in theAuthenticationRequest
withauthenticationControls
.- Parameters:
criteria
- containing request controls- Returns:
- combined request controls or null
-