org.ldaptive.auth
Class AbstractAuthenticationHandler

java.lang.Object
  extended by org.ldaptive.auth.AbstractAuthenticationHandler
All Implemented Interfaces:
AuthenticationHandler
Direct Known Subclasses:
AbstractBindAuthenticationHandler, AbstractCompareAuthenticationHandler

public abstract class AbstractAuthenticationHandler
extends Object
implements AuthenticationHandler

Base class for an LDAP authentication implementations.

Version:
$Revision: 3235 $ $Date: 2017-08-28 15:48:23 -0400 (Mon, 28 Aug 2017) $
Author:
Middleware Services

Field Summary
protected  org.slf4j.Logger logger
          Logger for this class.
 
Constructor Summary
AbstractAuthenticationHandler()
           
 
Method Summary
 AuthenticationHandlerResponse authenticate(AuthenticationCriteria ac)
          Perform an ldap authentication.
protected abstract  AuthenticationHandlerResponse authenticateInternal(Connection c, AuthenticationCriteria criteria)
          Authenticate on the supplied connection using the supplied criteria.
 RequestControl[] getAuthenticationControls()
          Returns the controls for this authentication handler.
protected abstract  Connection getConnection()
          Returns a connection that the authentication operation should be performed on.
protected  RequestControl[] processRequestControls(AuthenticationCriteria criteria)
          Combines request controls in the AuthenticationRequest with authenticationControls.
 void setAuthenticationControls(RequestControl... c)
          Sets the controls for this authentication handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.slf4j.Logger logger
Logger for this class.

Constructor Detail

AbstractAuthenticationHandler

public AbstractAuthenticationHandler()
Method Detail

getAuthenticationControls

public RequestControl[] getAuthenticationControls()
Returns the controls for this authentication handler.

Returns:
controls

setAuthenticationControls

public void setAuthenticationControls(RequestControl... c)
Sets the controls for this authentication handler.

Parameters:
c - controls to set

authenticate

public AuthenticationHandlerResponse authenticate(AuthenticationCriteria ac)
                                           throws LdapException
Perform an ldap authentication.

Specified by:
authenticate in interface AuthenticationHandler
Parameters:
ac - to perform the authentication with
Returns:
authentication handler response
Throws:
LdapException - if ldap operation fails

getConnection

protected abstract Connection getConnection()
                                     throws LdapException
Returns a connection that the authentication operation should be performed on.

Returns:
connection
Throws:
LdapException - if an error occurs provisioning the connection

authenticateInternal

protected abstract AuthenticationHandlerResponse authenticateInternal(Connection c,
                                                                      AuthenticationCriteria criteria)
                                                               throws LdapException
Authenticate on the supplied connection using the supplied criteria.

Parameters:
c - to authenticate on
criteria - criteria to authenticate with
Returns:
authentication handler response
Throws:
LdapException - if the authentication fails

processRequestControls

protected RequestControl[] processRequestControls(AuthenticationCriteria criteria)
Combines request controls in the AuthenticationRequest with authenticationControls.

Parameters:
criteria - containing request controls
Returns:
combined request controls or null


Copyright © 2003-2017 Virginia Tech. All Rights Reserved.