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

java.lang.Object
  extended by edu.vt.middleware.ldap.auth.handler.CompareAuthorizationHandler
All Implemented Interfaces:
AuthorizationHandler

public class CompareAuthorizationHandler
extends Object
implements AuthorizationHandler

CompareAuthorizationHandler performs a compare operation with a custom filter. The DN of the authenticated user is automatically provided as the {0} variable in the search filter arguments.

Version:
$Revision: 1330 $
Author:
Middleware Services

Field Summary
protected  org.apache.commons.logging.Log logger
          Log for this class.
 
Constructor Summary
CompareAuthorizationHandler()
          Default constructor.
CompareAuthorizationHandler(SearchFilter sf)
          Creates a new CompareAuthorizationHandler with the supplied search filter.
 
Method Summary
 SearchFilter getSearchFilter()
          Returns the search filter.
 void process(AuthenticationCriteria ac, LdapContext ctx)
          Process an authorization after an ldap authentication.
 void setSearchFilter(SearchFilter sf)
          Sets the search filter.
 String toString()
          Provides a descriptive string representation of this authorization handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Log for this class.

Constructor Detail

CompareAuthorizationHandler

public CompareAuthorizationHandler()
Default constructor.


CompareAuthorizationHandler

public CompareAuthorizationHandler(SearchFilter sf)
Creates a new CompareAuthorizationHandler with the supplied search filter.

Parameters:
sf - SearchFilter
Method Detail

getSearchFilter

public SearchFilter getSearchFilter()
Returns the search filter.

Returns:
SearchFilter

setSearchFilter

public void setSearchFilter(SearchFilter sf)
Sets the search filter.

Parameters:
sf - SearchFilter

process

public void process(AuthenticationCriteria ac,
                    LdapContext ctx)
             throws NamingException
Process an authorization after an ldap authentication. The supplied LdapContext should not be closed in this method. Implementations should throw AuthorizationException to indicate an authorization failure.

Specified by:
process in interface AuthorizationHandler
Parameters:
ac - AuthenticationCriteria used to perform the authentication
ctx - LdapContext authenticated context used to perform the bind
Throws:
NamingException - if an LDAP error occurs

toString

public String toString()
Provides a descriptive string representation of this authorization handler.

Overrides:
toString in class Object
Returns:
String of the form $Classname::$filter.


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