Package edu.vt.middleware.ldap.auth
Class AuthenticatorConfig
- java.lang.Object
-
- edu.vt.middleware.ldap.props.AbstractPropertyConfig
-
- edu.vt.middleware.ldap.LdapConfig
-
- edu.vt.middleware.ldap.auth.AuthenticatorConfig
-
- All Implemented Interfaces:
PropertyConfig
public class AuthenticatorConfig extends LdapConfig
AuthenticatorConfigcontains all the configuration data that theAuthenticatorneeds to control authentication.- Version:
- $Revision: 1330 $ $Date: 2010-05-24 00:10:53 +0200 (Mon, 24 May 2010) $
- Author:
- Middleware Services
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class edu.vt.middleware.ldap.LdapConfig
LdapConfig.SearchScope
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPROPERTIES_DOMAINDomain 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
Constructors Constructor Description AuthenticatorConfig()Default constructor.AuthenticatorConfig(java.lang.String ldapUrl, java.lang.String baseDn)This will create a newAuthenticatorConfigwith the supplied ldap url and base Strings.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AuthenticatorConfigcreateFromProperties(java.io.InputStream is)Create an instance of this class initialized with properties from the input stream.booleangetAllowMultipleDns()This returns the allowMultipleDns of theAuthenticator.AuthenticationHandlergetAuthenticationHandler()This returns the authentication handler.AuthenticationResultHandler[]getAuthenticationResultHandlers()This returns the handlers to use for processing authentications.java.lang.StringgetAuthorizationFilter()This returns the filter used to authorize users.java.lang.Object[]getAuthorizationFilterArgs()This returns the filter arguments used to authorize users.AuthorizationHandler[]getAuthorizationHandlers()This returns the handlers to use for processing authorization.booleangetConstructDn()This returns the constructDn of theAuthenticator.java.lang.ObjectgetCredential()This returns the credential of theAuthenticator.DnResolvergetDnResolver()This returns the DN resolver.java.lang.StringgetPropertiesDomain()This returns the properties domain for this property config.booleangetSubtreeSearch()This returns the subtreeSearch of theAuthenticator.java.lang.StringgetUser()This returns the user of theAuthenticator.java.lang.String[]getUserField()This returns the user field(s) of theAuthenticator.java.lang.StringgetUserFilter()This returns the filter used to search for the user.java.lang.Object[]getUserFilterArgs()This returns the filter arguments used to search for the user.booleanhasEnvironmentProperty(java.lang.String name)This returns whether the supplied property exists.voidsetAllowMultipleDns(boolean allowMultipleDns)This sets the allowMultipleDns for theAuthentication.voidsetAuthenticationHandler(AuthenticationHandler handler)This sets the authentication handler.voidsetAuthenticationResultHandlers(AuthenticationResultHandler[] handlers)This sets the handlers for processing authentications.voidsetAuthorizationFilter(java.lang.String authorizationFilter)This sets the filter used to authorize users.voidsetAuthorizationFilterArgs(java.lang.Object[] authorizationFilterArgs)This sets the filter arguments used to authorize users.voidsetAuthorizationHandlers(AuthorizationHandler[] handlers)This sets the handlers for processing authorization.voidsetConstructDn(boolean constructDn)This sets the constructDn for theAuthenticator.voidsetCredential(java.lang.Object credential)This sets the credential for theAuthenticatorto use for authentication.voidsetDnResolver(DnResolver resolver)This sets the DN resolver.voidsetEnvironmentProperties(java.lang.String name, java.lang.String value)This adds environment properties to this object.voidsetSubtreeSearch(boolean subtreeSearch)This sets the subtreeSearch for theAuthenticator.voidsetUser(java.lang.String user)This sets the username for theAuthenticatorto use for authentication.voidsetUserField(java.lang.String[] userField)This sets the user fields for theAuthenticator.voidsetUserFilter(java.lang.String userFilter)This sets the filter used to search for users.voidsetUserFilterArgs(java.lang.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
-
-
-
-
Field Detail
-
PROPERTIES_DOMAIN
public static final java.lang.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(java.lang.String ldapUrl, java.lang.String baseDn)This will create a newAuthenticatorConfigwith the supplied ldap url and base Strings.- Parameters:
ldapUrl-StringLDAP URLbaseDn-StringLDAP base DN
-
-
Method Detail
-
getUserField
public java.lang.String[] getUserField()
This returns the user field(s) of theAuthenticator.- Returns:
String[]- user field name(s)
-
getUserFilter
public java.lang.String getUserFilter()
This returns the filter used to search for the user.- Returns:
String- filter
-
getUserFilterArgs
public java.lang.Object[] getUserFilterArgs()
This returns the filter arguments used to search for the user.- Returns:
Object[]- filter arguments
-
getUser
public java.lang.String getUser()
This returns the user of theAuthenticator.- Returns:
String- user name
-
getCredential
public java.lang.Object getCredential()
This returns the credential of theAuthenticator.- Returns:
Object- user credential
-
getAuthorizationFilter
public java.lang.String getAuthorizationFilter()
This returns the filter used to authorize users.- Returns:
String- filter
-
getAuthorizationFilterArgs
public java.lang.Object[] getAuthorizationFilterArgs()
This returns the filter arguments used to authorize users.- Returns:
Object[]- filter arguments
-
getConstructDn
public boolean getConstructDn()
This returns the constructDn of theAuthenticator.- Returns:
boolean- whether the DN will be constructed
-
getAllowMultipleDns
public boolean getAllowMultipleDns()
This returns the allowMultipleDns of theAuthenticator.- Returns:
boolean- whether an exception will be thrown if multiple DNs are found
-
getSubtreeSearch
public boolean getSubtreeSearch()
This returns the subtreeSearch of theAuthenticator.- 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(java.lang.String[] userField)
This sets the user fields for theAuthenticator. The user field is used to lookup a user's dn.- Parameters:
userField-String[]username
-
setUserFilter
public void setUserFilter(java.lang.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(java.lang.Object[] userFilterArgs)
This sets the filter arguments used to search for users.- Parameters:
userFilterArgs-Object[]
-
setUser
public void setUser(java.lang.String user)
This sets the username for theAuthenticatorto use for authentication.- Parameters:
user-Stringusername
-
setCredential
public void setCredential(java.lang.Object credential)
This sets the credential for theAuthenticatorto use for authentication.- Parameters:
credential-Object
-
setAuthorizationFilter
public void setAuthorizationFilter(java.lang.String authorizationFilter)
This sets the filter used to authorize users. If not set, no authorization is performed.- Parameters:
authorizationFilter-String
-
setAuthorizationFilterArgs
public void setAuthorizationFilterArgs(java.lang.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 theAuthenticator. If true, thednResolveris set toConstructDnResolver. If false, thednResolveris set toSearchDnResolver.- Parameters:
constructDn-boolean
-
setAllowMultipleDns
public void setAllowMultipleDns(boolean allowMultipleDns)
This sets the allowMultipleDns for theAuthentication. If false an exception will be thrown ifAuthenticator.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 theAuthenticator. If true, the DN used for authenticating will be searched for over the entireLdapConfig.getBaseDn(). Otherwise the DN will be search for in theLdapConfig.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 java.lang.String getPropertiesDomain()
This returns the properties domain for this property config.- Specified by:
getPropertiesDomainin interfacePropertyConfig- Overrides:
getPropertiesDomainin classLdapConfig- Returns:
Stringproperties domain
-
setEnvironmentProperties
public void setEnvironmentProperties(java.lang.String name, java.lang.String value)This adds environment properties to this object. If name or value is null, then this method does nothing.- Specified by:
setEnvironmentPropertiesin interfacePropertyConfig- Overrides:
setEnvironmentPropertiesin classLdapConfig- Parameters:
name-Stringproperty namevalue-Stringproperty value
-
hasEnvironmentProperty
public boolean hasEnvironmentProperty(java.lang.String name)
This returns whether the supplied property exists.- Specified by:
hasEnvironmentPropertyin interfacePropertyConfig- Overrides:
hasEnvironmentPropertyin classLdapConfig- Parameters:
name-Stringto check- Returns:
booleanwhether the supplied property exists
-
createFromProperties
public static AuthenticatorConfig createFromProperties(java.io.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:
AuthenticatorConfiginitialized ldap pool config
-
-