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 java.lang.Object implements AuthenticationHandler, ConnectionFactoryManager
Base class for an LDAP authentication implementations.- Author:
- Middleware Services
-
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.LoggerloggerLogger for this class.
-
Constructor Summary
Constructors Constructor Description AbstractAuthenticationHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description AuthenticationHandlerResponseauthenticate(AuthenticationCriteria ac)Perform an ldap authentication.protected abstract AuthenticationHandlerResponseauthenticateInternal(Connection c, AuthenticationCriteria criteria)Authenticate on the supplied connection using the supplied criteria.RequestControl[]getAuthenticationControls()Returns the controls for this authentication handler.ConnectionFactorygetConnectionFactory()Returns the connection factory.protected RequestControl[]processRequestControls(AuthenticationCriteria criteria)Combines request controls in theAuthenticationRequestwithauthenticationControls.voidsetAuthenticationControls(RequestControl... cntrls)Sets the controls for this authentication handler.voidsetConnectionFactory(ConnectionFactory cf)Sets the connection factory.
-
-
-
Method Detail
-
getConnectionFactory
public ConnectionFactory getConnectionFactory()
Description copied from interface:ConnectionFactoryManagerReturns the connection factory.- Specified by:
getConnectionFactoryin interfaceConnectionFactoryManager- Returns:
- connection factory
-
setConnectionFactory
public void setConnectionFactory(ConnectionFactory cf)
Description copied from interface:ConnectionFactoryManagerSets the connection factory.- Specified by:
setConnectionFactoryin interfaceConnectionFactoryManager- Parameters:
cf- connection factory
-
getAuthenticationControls
public RequestControl[] getAuthenticationControls()
Returns the controls for this authentication handler.- Returns:
- controls
-
setAuthenticationControls
public void setAuthenticationControls(RequestControl... cntrls)
Sets the controls for this authentication handler.- Parameters:
cntrls- controls to set
-
authenticate
public AuthenticationHandlerResponse authenticate(AuthenticationCriteria ac) throws LdapException
Description copied from interface:AuthenticationHandlerPerform an ldap authentication.- Specified by:
authenticatein 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
protected RequestControl[] processRequestControls(AuthenticationCriteria criteria)
Combines request controls in theAuthenticationRequestwithauthenticationControls.- Parameters:
criteria- containing request controls- Returns:
- combined request controls or null
-
-