Class CompareAuthorizationHandler
- java.lang.Object
-
- edu.vt.middleware.ldap.auth.handler.CompareAuthorizationHandler
-
- All Implemented Interfaces:
AuthorizationHandler
public class CompareAuthorizationHandler extends java.lang.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
Fields Modifier and Type Field Description protected org.apache.commons.logging.Log
logger
Log for this class.
-
Constructor Summary
Constructors Constructor Description CompareAuthorizationHandler()
Default constructor.CompareAuthorizationHandler(SearchFilter sf)
Creates a newCompareAuthorizationHandler
with the supplied search filter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SearchFilter
getSearchFilter()
Returns the search filter.void
process(AuthenticationCriteria ac, javax.naming.ldap.LdapContext ctx)
Process an authorization after an ldap authentication.void
setSearchFilter(SearchFilter sf)
Sets the search filter.java.lang.String
toString()
Provides a descriptive string representation of this authorization handler.
-
-
-
Constructor Detail
-
CompareAuthorizationHandler
public CompareAuthorizationHandler()
Default constructor.
-
CompareAuthorizationHandler
public CompareAuthorizationHandler(SearchFilter sf)
Creates a newCompareAuthorizationHandler
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, javax.naming.ldap.LdapContext ctx) throws javax.naming.NamingException
Process an authorization after an ldap authentication. The supplied LdapContext should not be closed in this method. Implementations should throwAuthorizationException
to indicate an authorization failure.- Specified by:
process
in interfaceAuthorizationHandler
- Parameters:
ac
-AuthenticationCriteria
used to perform the authenticationctx
-LdapContext
authenticated context used to perform the bind- Throws:
javax.naming.NamingException
- if an LDAP error occurs
-
toString
public java.lang.String toString()
Provides a descriptive string representation of this authorization handler.- Overrides:
toString
in classjava.lang.Object
- Returns:
- String of the form $Classname::$filter.
-
-