edu.vt.middleware.ldap.auth
Class AuthenticatorConfig

java.lang.Object
  extended by edu.vt.middleware.ldap.props.AbstractPropertyConfig
      extended by edu.vt.middleware.ldap.LdapConfig
          extended by edu.vt.middleware.ldap.auth.AuthenticatorConfig
All Implemented Interfaces:
PropertyConfig

public class AuthenticatorConfig
extends LdapConfig

AuthenticatorConfig contains all the configuration data that the Authenticator needs to control authentication.

Version:
$Revision: 1330 $ $Date: 2010-05-23 18:10:53 -0400 (Sun, 23 May 2010) $
Author:
Middleware Services

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.vt.middleware.ldap.LdapConfig
LdapConfig.SearchScope
 
Field Summary
static String PROPERTIES_DOMAIN
          Domain to look for ldap properties in, value is "edu.vt.middleware.ldap.auth.".
 
Fields inherited from class edu.vt.middleware.ldap.props.AbstractPropertyConfig
logger
 
Constructor Summary
AuthenticatorConfig()
          Default constructor.
AuthenticatorConfig(String ldapUrl, String baseDn)
          This will create a new AuthenticatorConfig with the supplied ldap url and base Strings.
 
Method Summary
static AuthenticatorConfig createFromProperties(InputStream is)
          Create an instance of this class initialized with properties from the input stream.
 boolean getAllowMultipleDns()
          This returns the allowMultipleDns of the Authenticator.
 AuthenticationHandler getAuthenticationHandler()
          This returns the authentication handler.
 AuthenticationResultHandler[] getAuthenticationResultHandlers()
          This returns the handlers to use for processing authentications.
 String getAuthorizationFilter()
          This returns the filter used to authorize users.
 Object[] getAuthorizationFilterArgs()
          This returns the filter arguments used to authorize users.
 AuthorizationHandler[] getAuthorizationHandlers()
          This returns the handlers to use for processing authorization.
 boolean getConstructDn()
          This returns the constructDn of the Authenticator.
 Object getCredential()
          This returns the credential of the Authenticator.
 DnResolver getDnResolver()
          This returns the DN resolver.
 String getPropertiesDomain()
          This returns the properties domain for this property config.
 boolean getSubtreeSearch()
          This returns the subtreeSearch of the Authenticator.
 String getUser()
          This returns the user of the Authenticator.
 String[] getUserField()
          This returns the user field(s) of the Authenticator.
 String getUserFilter()
          This returns the filter used to search for the user.
 Object[] getUserFilterArgs()
          This returns the filter arguments used to search for the user.
 boolean hasEnvironmentProperty(String name)
          This returns whether the supplied property exists.
 void setAllowMultipleDns(boolean allowMultipleDns)
          This sets the allowMultipleDns for the Authentication.
 void setAuthenticationHandler(AuthenticationHandler handler)
          This sets the authentication handler.
 void setAuthenticationResultHandlers(AuthenticationResultHandler[] handlers)
          This sets the handlers for processing authentications.
 void setAuthorizationFilter(String authorizationFilter)
          This sets the filter used to authorize users.
 void setAuthorizationFilterArgs(Object[] authorizationFilterArgs)
          This sets the filter arguments used to authorize users.
 void setAuthorizationHandlers(AuthorizationHandler[] handlers)
          This sets the handlers for processing authorization.
 void setConstructDn(boolean constructDn)
          This sets the constructDn for the Authenticator.
 void setCredential(Object credential)
          This sets the credential for the Authenticator to use for authentication.
 void setDnResolver(DnResolver resolver)
          This sets the DN resolver.
 void setEnvironmentProperties(String name, String value)
          This adds environment properties to this object. If name or value is null, then this method does nothing.
 void setSubtreeSearch(boolean subtreeSearch)
          This sets the subtreeSearch for the Authenticator.
 void setUser(String user)
          This sets the username for the Authenticator to use for authentication.
 void setUserField(String[] userField)
          This sets the user fields for the Authenticator.
 void setUserFilter(String userFilter)
          This sets the filter used to search for users.
 void setUserFilterArgs(Object[] userFilterArgs)
          This sets the filter arguments used to search for users.
 
Methods inherited from class edu.vt.middleware.ldap.LdapConfig
getAuthoritative, getAuthtype, getBase, getBaseDn, getBatchSize, getBinaryAttributes, getBindCredential, getBindDn, getCompareSearchControls, getConnectionHandler, getContextFactory, getCountLimit, getDerefAliases, getDerefLinkFlag, getDnsUrl, getEnvironment, getEnvironmentProperties, getHandlerIgnoreExceptions, getHost, getHostnameVerifier, getLanguage, getLdapUrl, getLogCredentials, getOperationRetry, getOperationRetryBackoff, getOperationRetryExceptions, getOperationRetryWait, getPagedResultsSize, getPort, getReferral, getReturningObjFlag, getSaslAuthorizationId, getSaslRealm, getSearchControls, getSearchResultHandlers, getSearchScope, getServiceCredential, getServiceUser, getSsl, getSslSocketFactory, getTimeLimit, getTimeout, getTls, getTypesOnly, isAnonymousAuth, isAuthoritative, isCramMD5Auth, isDigestMD5Auth, isExternalAuth, isGSSAPIAuth, isObjectSearchScope, isOneLevelSearchScope, isSaslAuth, isSimpleAuth, isSslEnabled, isStrongAuth, isSubTreeSearchScope, isTlsEnabled, isTypesOnly, setAuthoritative, setAuthtype, setBase, setBaseDn, setBatchSize, setBinaryAttributes, setBindCredential, setBindDn, setConnectionHandler, setContextFactory, setCountLimit, setDerefAliases, setDerefLinkFlag, setDnsUrl, setHandlerIgnoreExceptions, setHost, setHostnameVerifier, setLanguage, setLdapUrl, setLogCredentials, setOperationRetry, setOperationRetryBackoff, setOperationRetryExceptions, setOperationRetryWait, setPagedResultsSize, setPort, setReferral, setReturningObjFlag, setSaslAuthorizationId, setSaslRealm, setSearchResultHandlers, setSearchScope, setService, setServiceCredential, setServiceUser, setSsl, setSslSocketFactory, setTimeLimit, setTimeout, setTls, setTracePackets, setTypesOnly, toString, useHostnameVerifier, useSslSocketFactory
 
Methods inherited from class edu.vt.middleware.ldap.props.AbstractPropertyConfig
checkImmutable, checkStringInput, makeImmutable, setEnvironmentProperties, setEnvironmentProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROPERTIES_DOMAIN

public static final String PROPERTIES_DOMAIN
Domain to look for ldap properties in, value is "edu.vt.middleware.ldap.auth.".

See Also:
Constant Field Values
Constructor Detail

AuthenticatorConfig

public AuthenticatorConfig()
Default constructor.


AuthenticatorConfig

public AuthenticatorConfig(String ldapUrl,
                           String baseDn)
This will create a new AuthenticatorConfig with the supplied ldap url and base Strings.

Parameters:
ldapUrl - String LDAP URL
baseDn - String LDAP base DN
Method Detail

getUserField

public String[] getUserField()
This returns the user field(s) of the Authenticator.

Returns:
String[] - user field name(s)

getUserFilter

public String getUserFilter()
This returns the filter used to search for the user.

Returns:
String - filter

getUserFilterArgs

public Object[] getUserFilterArgs()
This returns the filter arguments used to search for the user.

Returns:
Object[] - filter arguments

getUser

public String getUser()
This returns the user of the Authenticator.

Returns:
String - user name

getCredential

public Object getCredential()
This returns the credential of the Authenticator.

Returns:
Object - user credential

getAuthorizationFilter

public String getAuthorizationFilter()
This returns the filter used to authorize users.

Returns:
String - filter

getAuthorizationFilterArgs

public Object[] getAuthorizationFilterArgs()
This returns the filter arguments used to authorize users.

Returns:
Object[] - filter arguments

getConstructDn

public boolean getConstructDn()
This returns the constructDn of the Authenticator.

Returns:
boolean - whether the DN will be constructed

getAllowMultipleDns

public boolean getAllowMultipleDns()
This returns the allowMultipleDns of the Authenticator.

Returns:
boolean - whether an exception will be thrown if multiple DNs are found

getSubtreeSearch

public boolean getSubtreeSearch()
This returns the subtreeSearch of the Authenticator.

Returns:
boolean - whether the DN will be searched for over the entire base

getDnResolver

public DnResolver getDnResolver()
This returns the DN resolver.

Returns:
DnResolver

getAuthenticationHandler

public AuthenticationHandler getAuthenticationHandler()
This returns the authentication handler.

Returns:
AuthenticationHandler

getAuthenticationResultHandlers

public AuthenticationResultHandler[] getAuthenticationResultHandlers()
This returns the handlers to use for processing authentications.

Returns:
AuthenticationResultHandler[]

getAuthorizationHandlers

public AuthorizationHandler[] getAuthorizationHandlers()
This returns the handlers to use for processing authorization.

Returns:
AuthorizationHandler[]

setUserField

public void setUserField(String[] userField)
This sets the user fields for the Authenticator. The user field is used to lookup a user's dn.

Parameters:
userField - String[] username

setUserFilter

public void setUserFilter(String userFilter)
This sets the filter used to search for users. If not set, the user field is used to build a search filter.

Parameters:
userFilter - String

setUserFilterArgs

public void setUserFilterArgs(Object[] userFilterArgs)
This sets the filter arguments used to search for users.

Parameters:
userFilterArgs - Object[]

setUser

public void setUser(String user)
This sets the username for the Authenticator to use for authentication.

Parameters:
user - String username

setCredential

public void setCredential(Object credential)
This sets the credential for the Authenticator to use for authentication.

Parameters:
credential - Object

setAuthorizationFilter

public void setAuthorizationFilter(String authorizationFilter)
This sets the filter used to authorize users. If not set, no authorization is performed.

Parameters:
authorizationFilter - String

setAuthorizationFilterArgs

public void setAuthorizationFilterArgs(Object[] authorizationFilterArgs)
This sets the filter arguments used to authorize users.

Parameters:
authorizationFilterArgs - Object[]

setConstructDn

public void setConstructDn(boolean constructDn)
This sets the constructDn for the Authenticator. If true, the dnResolver is set to ConstructDnResolver. If false, the dnResolver is set to SearchDnResolver.

Parameters:
constructDn - boolean

setAllowMultipleDns

public void setAllowMultipleDns(boolean allowMultipleDns)
This sets the allowMultipleDns for the Authentication. If false an exception will be thrown if Authenticator.getDn(String) finds more than one DN matching it's filter. Otherwise the first DN found is returned.

Parameters:
allowMultipleDns - boolean

setSubtreeSearch

public void setSubtreeSearch(boolean subtreeSearch)
This sets the subtreeSearch for the Authenticator. If true, the DN used for authenticating will be searched for over the entire LdapConfig.getBaseDn(). Otherwise the DN will be search for in the LdapConfig.getBaseDn() context.

Parameters:
subtreeSearch - boolean

setDnResolver

public void setDnResolver(DnResolver resolver)
This sets the DN resolver.

Parameters:
resolver - DnResolver

setAuthenticationHandler

public void setAuthenticationHandler(AuthenticationHandler handler)
This sets the authentication handler.

Parameters:
handler - AuthenticationHandler

setAuthenticationResultHandlers

public void setAuthenticationResultHandlers(AuthenticationResultHandler[] handlers)
This sets the handlers for processing authentications.

Parameters:
handlers - AuthenticationResultHandler[]

setAuthorizationHandlers

public void setAuthorizationHandlers(AuthorizationHandler[] handlers)
This sets the handlers for processing authorization.

Parameters:
handlers - AuthorizationHandler[]

getPropertiesDomain

public String getPropertiesDomain()
This returns the properties domain for this property config.

Specified by:
getPropertiesDomain in interface PropertyConfig
Overrides:
getPropertiesDomain in class LdapConfig
Returns:
String properties domain

setEnvironmentProperties

public void setEnvironmentProperties(String name,
                                     String value)
This adds environment properties to this object. If name or value is null, then this method does nothing.

Specified by:
setEnvironmentProperties in interface PropertyConfig
Overrides:
setEnvironmentProperties in class LdapConfig
Parameters:
name - String property name
value - String property value

hasEnvironmentProperty

public boolean hasEnvironmentProperty(String name)
This returns whether the supplied property exists.

Specified by:
hasEnvironmentProperty in interface PropertyConfig
Overrides:
hasEnvironmentProperty in class LdapConfig
Parameters:
name - String to check
Returns:
boolean whether the supplied property exists

createFromProperties

public static AuthenticatorConfig createFromProperties(InputStream is)
Create an instance of this class initialized with properties from the input stream. If the input stream is null, load properties from the default properties file.

Parameters:
is - to load properties from
Returns:
AuthenticatorConfig initialized ldap pool config


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