org.ldaptive.auth
Class AbstractCompareAuthenticationHandler

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

public abstract class AbstractCompareAuthenticationHandler
extends AbstractAuthenticationHandler

Provides implementation common to compare authentication handlers.

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

Nested Class Summary
static class AbstractCompareAuthenticationHandler.Scheme
          Represents a password scheme used for attribute comparison.
 
Field Summary
protected static String DEFAULT_ATTRIBUTE
          Default password attribute.
protected static String DEFAULT_SCHEME
          Default password scheme.
 
Fields inherited from class org.ldaptive.auth.AbstractAuthenticationHandler
logger
 
Constructor Summary
AbstractCompareAuthenticationHandler()
           
 
Method Summary
protected  AuthenticationHandlerResponse authenticateInternal(Connection c, AuthenticationCriteria criteria)
          Authenticate on the supplied connection using the supplied criteria.
protected  byte[] digestCredential(Credential credential, String algorithm)
          Digests the supplied credential using the supplied algorithm.
protected abstract  Connection getConnection()
          Returns a connection that the compare operation should be performed on.
 String getPasswordAttribute()
          Returns the password attribute.
 String getPasswordScheme()
          Returns the password scheme.
 void setPasswordAttribute(String s)
          Sets the password attribute.
 void setPasswordScheme(String s)
          Sets the password scheme.
 
Methods inherited from class org.ldaptive.auth.AbstractAuthenticationHandler
authenticate, getAuthenticationControls, processRequestControls, setAuthenticationControls
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SCHEME

protected static final String DEFAULT_SCHEME
Default password scheme. Value is "SHA:SHA".

See Also:
Constant Field Values

DEFAULT_ATTRIBUTE

protected static final String DEFAULT_ATTRIBUTE
Default password attribute. Value is "userPassword".

See Also:
Constant Field Values
Constructor Detail

AbstractCompareAuthenticationHandler

public AbstractCompareAuthenticationHandler()
Method Detail

getPasswordScheme

public String getPasswordScheme()
Returns the password scheme.

Returns:
password scheme

setPasswordScheme

public void setPasswordScheme(String s)
Sets the password scheme.

Parameters:
s - password scheme

getPasswordAttribute

public String getPasswordAttribute()
Returns the password attribute.

Returns:
password attribute

setPasswordAttribute

public void setPasswordAttribute(String s)
Sets the password attribute. Must equal a readable attribute in LDAP scheme.

Parameters:
s - password attribute

authenticateInternal

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

Specified by:
authenticateInternal in class AbstractAuthenticationHandler
Parameters:
c - to authenticate on
criteria - criteria to authenticate with
Returns:
authentication handler response
Throws:
LdapException - if the authentication fails

digestCredential

protected byte[] digestCredential(Credential credential,
                                  String algorithm)
                           throws LdapException
Digests the supplied credential using the supplied algorithm.

Parameters:
credential - to digest
algorithm - type of digest to use
Returns:
digested credential
Throws:
LdapException - if the supplied algorithm cannot be found

getConnection

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

Specified by:
getConnection in class AbstractAuthenticationHandler
Returns:
connection
Throws:
LdapException - if an error occurs provisioning the connection


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