edu.vt.middleware.ldap.auth.handler
Class CompareAuthenticationHandler

java.lang.Object
  extended by edu.vt.middleware.ldap.auth.handler.AbstractAuthenticationHandler
      extended by edu.vt.middleware.ldap.auth.handler.CompareAuthenticationHandler
All Implemented Interfaces:
AuthenticationHandler

public class CompareAuthenticationHandler
extends AbstractAuthenticationHandler

CompareAuthenticationHandler provides an LDAP authentication implementation that leverages a compare operation against the userPassword attribute. The default password scheme used is 'SHA'.

Version:
$Revision: 1330 $
Author:
Middleware Services

Field Summary
 
Fields inherited from class edu.vt.middleware.ldap.auth.handler.AbstractAuthenticationHandler
config, logger
 
Constructor Summary
CompareAuthenticationHandler()
          Default constructor.
CompareAuthenticationHandler(AuthenticatorConfig ac)
          Creates a new CompareAuthenticationHandler with the supplied authenticator config.
 
Method Summary
 void authenticate(ConnectionHandler ch, AuthenticationCriteria ac)
          Perform an ldap authentication. Implementations should throw AuthenticationException to indicate an authentication failure. The resulting LdapContext can be retrieved from the connection handler if it is needed.
 String getPasswordScheme()
          Returns the password scheme.
 CompareAuthenticationHandler newInstance()
          Returns a separate instance of this authentication handler.
 void setPasswordScheme(String s)
          Sets the password scheme.
 
Methods inherited from class edu.vt.middleware.ldap.auth.handler.AbstractAuthenticationHandler
setAuthenticatorConfig
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompareAuthenticationHandler

public CompareAuthenticationHandler()
Default constructor.


CompareAuthenticationHandler

public CompareAuthenticationHandler(AuthenticatorConfig ac)
Creates a new CompareAuthenticationHandler with the supplied authenticator config.

Parameters:
ac - authenticator config
Method Detail

getPasswordScheme

public String getPasswordScheme()
Returns the password scheme.

Returns:
password scheme

setPasswordScheme

public void setPasswordScheme(String s)
Sets the password scheme. Must equal a known message digest algorithm.

Parameters:
s - password scheme

authenticate

public void authenticate(ConnectionHandler ch,
                         AuthenticationCriteria ac)
                  throws NamingException
Perform an ldap authentication. Implementations should throw AuthenticationException to indicate an authentication failure. The resulting LdapContext can be retrieved from the connection handler if it is needed.

Specified by:
authenticate in interface AuthenticationHandler
Specified by:
authenticate in class AbstractAuthenticationHandler
Parameters:
ch - ConnectionHandler to communicate with the LDAP
ac - AuthenticationCriteria to perform the authentication with
Throws:
NamingException - if an LDAP error occurs

newInstance

public CompareAuthenticationHandler newInstance()
Returns a separate instance of this authentication handler.

Specified by:
newInstance in interface AuthenticationHandler
Specified by:
newInstance in class AbstractAuthenticationHandler
Returns:
authentication handler


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