Package net.shibboleth.idp.authn.config
Class LDAPAuthenticationFactoryBean
java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<Authenticator>
net.shibboleth.idp.authn.config.LDAPAuthenticationFactoryBean
- All Implemented Interfaces:
Aware,BeanClassLoaderAware,BeanFactoryAware,DisposableBean,FactoryBean<Authenticator>,InitializingBean
LDAP Authentication configuration. See ldap-authn-config.xml
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum that defines authenticator configuration.static enumEnum that defines LDAP connection strategy.static enumEnum that defines an LDAP pool passivator.static enumEnum that defines LDAP trust configuration. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate PeriodAuthentication handler account state expiration period.private intAuthentication handler account state login failures.private PeriodAuthentication handler account state warning period.Type of authenticator to configure.private booleanWhether to automatically reconnect to the server when a connection is lost.private StringBase DN used to search for users.private StringPrivileged entry used to search for users.private StringCredential for the privileged entry.Type of passivator to configure for the bind pool.private DurationWait time for getting a connection from the pool.Type of connection strategy to configure.private DurationWait time for connects.private booleanWhether to use the allow-all hostname verifier.private booleanWhether to disable connection pooling for both binds and searches.private StringJava format string used to construct an LDAP DN.private DurationTime at which a connection has been idle and should be removed from the pool.private booleanWhether to use account state data as defined by active directory diagnostic messages.private booleanWhether to use account state data as defined by the EDirectory schema.private booleanWhether to use account state data as defined by the FreeIPA directory schema.private StringLDAP URL.private final org.slf4j.LoggerClass logger.private intMaximum pool size.private intMinimum pool size.private DurationPeriod at which to check and enforce the idle time.private DurationWait time for reconnects.private booleanWhether to return the LDAP entry even if the user BIND fails.private booleanWhether to resolve the user entry with the bind credentials.private DurationWait time for operation responses.private DurationWait time for startTLS responses.private booleanWhether to use a SUBTREE search with the baseDn.private CredentialConfigTrust configuration when using certificate based trust.private CredentialConfigTrust configuration when using truststore based trust.Type of trust model to configure.private booleanWhether to use the password expiration control with the BIND operation.private booleanWhether to use the password policy control with the BIND operation.private StringLDAP filter used to search for users.private booleanWhether to use startTLS for connections.private StringDN to perform connection pool validation against.private StringFilter to execute againstvalidateDn.private booleanWhether to validate connections when checked out from the pool.private DurationPeriod at which to validate periodically.private booleanWhether to validate connections periodically on a background thread.private org.apache.velocity.app.VelocityEngineVelocity engine used to materialize the LDAP filter.Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
loggerFields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ConnectionConfigReturns a new ConnectionConfig without a connection initializer.protected ConnectionConfigcreateConnectionConfig(ConnectionInitializer initializer) Returns a new ConnectionConfig with the supplied connection initializer.protected ConnectionPassivatorCreatesConnectionPassivatorobject.protected Authenticatorprotected PooledConnectionFactorycreatePooledConnectionFactory(String name, ConnectionConfig config) Returns a new pooled connection factory.protected PooledConnectionFactorycreatePooledConnectionFactory(String name, ConnectionConfig config, SearchConnectionValidator validator) Returns a new pooled connection factory using the supplied search validator.protected PooledConnectionFactorycreatePooledConnectionFactory(String name, ConnectionConfig config, SearchConnectionValidator validator, ConnectionPassivator passivator) Returns a new pooled connection factory using the supplied search validator and passivator.protected SearchConnectionValidatorcreateSearchConnectionValidator(String baseDn, String filter) CreateSearchConnectionValidator.protected SslConfigReturns a new SslConfig object derived from the configuredtrustType.protected voiddestroyInstance(Authenticator instance) Class<?>private StringGet theuserFilter.private org.apache.velocity.app.VelocityEngineGet thevelocityEngine.voidvoidsetAccountStateLoginFailures(int loginFailures) voidsetAccountStateWarningPeriod(Period period) voidsetActiveDirectory(boolean b) SetisActiveDirectory.voidsetAuthenticatorType(String type) SetauthenticatorType.voidsetAutoReconnect(boolean b) SetautoReconnect.voidSetbaseDn.voidSetbindDn.voidsetBindDnCredential(String credential) SetbindDnCredential.voidvoidsetBlockWaitTime(Duration time) SetblockWaitTime.voidvoidsetConnectTimeout(Duration timeout) SetconnectTimeout.voidsetDisableHostnameVerification(boolean b) voidsetDisablePooling(boolean b) SetdisablePooling.voidsetDnFormat(String format) SetdnFormat.voidsetEDirectory(boolean b) SetisEDirectory.voidsetFreeIPA(boolean b) SetisFreeIPA.voidsetIdleTime(Duration time) SetidleTime.voidsetLdapUrl(String url) SetldapUrl.voidsetMaxPoolSize(int size) SetmaxPoolSize.voidsetMinPoolSize(int size) SetminPoolSize.voidsetPrunePeriod(Duration period) SetprunePeriod.voidsetReconnectTimeout(Duration timeout) SetreconnectTimeout.voidsetResolveEntryOnFailure(boolean b) voidsetResolveEntryWithBindDn(boolean b) voidsetResponseTimeout(Duration timeout) SetresponseTimeout.voidsetStartTLSTimeout(Duration timeout) SetstartTLSTimeout.voidsetSubtreeSearch(boolean b) SetsubtreeSearch.voidvoidvoidsetTrustType(String type) SettrustType.voidsetUsePasswordExpiration(boolean b) voidsetUsePasswordPolicy(boolean b) voidsetUserFilter(String filter) SetuserFilter.voidsetUseStartTLS(boolean b) SetuseStartTLS.voidsetValidateDn(String dn) SetvalidateDn.voidsetValidateFilter(String filter) SetvalidateFilter.voidsetValidateOnCheckout(boolean b) SetvalidateOnCheckout.voidsetValidatePeriod(Duration period) SetvalidatePeriod.voidsetValidatePeriodically(boolean b) SetvalidatePeriodically.voidsetVelocityEngine(org.apache.velocity.app.VelocityEngine engine) SetvelocityEngine.toString()Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
authenticatorType
Type of authenticator to configure. -
trustType
Type of trust model to configure. -
connectionStrategyType
Type of connection strategy to configure. -
ldapUrl
LDAP URL. -
useStartTLS
private boolean useStartTLSWhether to use startTLS for connections. -
startTLSTimeout
Wait time for startTLS responses. -
disableHostnameVerification
private boolean disableHostnameVerificationWhether to use the allow-all hostname verifier. -
connectTimeout
Wait time for connects. -
responseTimeout
Wait time for operation responses. -
autoReconnect
private boolean autoReconnectWhether to automatically reconnect to the server when a connection is lost. -
reconnectTimeout
Wait time for reconnects. -
trustCertificatesCredentialConfig
Trust configuration when using certificate based trust. -
truststoreCredentialConfig
Trust configuration when using truststore based trust. -
disablePooling
private boolean disablePoolingWhether to disable connection pooling for both binds and searches. -
blockWaitTime
Wait time for getting a connection from the pool. -
minPoolSize
private int minPoolSizeMinimum pool size. -
maxPoolSize
private int maxPoolSizeMaximum pool size. -
validateOnCheckout
private boolean validateOnCheckoutWhether to validate connections when checked out from the pool. -
validatePeriodically
private boolean validatePeriodicallyWhether to validate connections periodically on a background thread. -
validatePeriod
Period at which to validate periodically. -
validateDn
DN to perform connection pool validation against. -
validateFilter
Filter to execute againstvalidateDn. -
bindPoolPassivatorType
Type of passivator to configure for the bind pool. -
prunePeriod
Period at which to check and enforce the idle time. -
idleTime
Time at which a connection has been idle and should be removed from the pool. -
dnFormat
Java format string used to construct an LDAP DN. SeeString.format(String, Object...). -
baseDn
Base DN used to search for users. -
userFilter
LDAP filter used to search for users. -
subtreeSearch
private boolean subtreeSearchWhether to use a SUBTREE search with the baseDn. -
resolveEntryOnFailure
private boolean resolveEntryOnFailureWhether to return the LDAP entry even if the user BIND fails. -
resolveEntryWithBindDn
private boolean resolveEntryWithBindDnWhether to resolve the user entry with the bind credentials. -
velocityEngine
private org.apache.velocity.app.VelocityEngine velocityEngineVelocity engine used to materialize the LDAP filter. -
bindDn
Privileged entry used to search for users. -
bindDnCredential
Credential for the privileged entry. -
usePasswordPolicy
private boolean usePasswordPolicyWhether to use the password policy control with the BIND operation. See draft-behera-ldap-password-policy. -
usePasswordExpiration
private boolean usePasswordExpirationWhether to use the password expiration control with the BIND operation. See draft-vchu-ldap-pwd-policy. -
isActiveDirectory
private boolean isActiveDirectoryWhether to use account state data as defined by active directory diagnostic messages. -
isFreeIPA
private boolean isFreeIPAWhether to use account state data as defined by the FreeIPA directory schema. -
isEDirectory
private boolean isEDirectoryWhether to use account state data as defined by the EDirectory schema. -
accountStateExpirationPeriod
Authentication handler account state expiration period. -
accountStateWarningPeriod
Authentication handler account state warning period. -
accountStateLoginFailures
private int accountStateLoginFailuresAuthentication handler account state login failures.
-
-
Constructor Details
-
LDAPAuthenticationFactoryBean
public LDAPAuthenticationFactoryBean()
-
-
Method Details
-
setAuthenticatorType
SetauthenticatorType.- Parameters:
type- what to set
-
setTrustType
SettrustType.- Parameters:
type- what to set
-
setConnectionStrategyType
- Parameters:
type- what to set
-
setLdapUrl
SetldapUrl.- Parameters:
url- what to set
-
setUseStartTLS
public void setUseStartTLS(boolean b) SetuseStartTLS.- Parameters:
b- what to set
-
setStartTLSTimeout
SetstartTLSTimeout.- Parameters:
timeout- what to set
-
setDisableHostnameVerification
public void setDisableHostnameVerification(boolean b) - Parameters:
b- what to set
-
setConnectTimeout
SetconnectTimeout.- Parameters:
timeout- what to set
-
setResponseTimeout
SetresponseTimeout.- Parameters:
timeout- what to set
-
setAutoReconnect
public void setAutoReconnect(boolean b) SetautoReconnect.- Parameters:
b- what to set
-
setReconnectTimeout
SetreconnectTimeout.- Parameters:
timeout- what to set
-
setTrustCertificatesCredentialConfig
- Parameters:
config- to set
-
setTruststoreCredentialConfig
- Parameters:
config- to set
-
setDisablePooling
public void setDisablePooling(boolean b) SetdisablePooling.- Parameters:
b- what to set
-
setBlockWaitTime
SetblockWaitTime.- Parameters:
time- what to set
-
setMinPoolSize
public void setMinPoolSize(int size) SetminPoolSize.- Parameters:
size- what to set
-
setMaxPoolSize
public void setMaxPoolSize(int size) SetmaxPoolSize.- Parameters:
size- what to set
-
setValidateOnCheckout
public void setValidateOnCheckout(boolean b) SetvalidateOnCheckout.- Parameters:
b- what to set
-
setValidatePeriodically
public void setValidatePeriodically(boolean b) SetvalidatePeriodically.- Parameters:
b- what to set
-
setValidatePeriod
SetvalidatePeriod.- Parameters:
period- what to set
-
setValidateDn
SetvalidateDn.- Parameters:
dn- what to set
-
setValidateFilter
SetvalidateFilter.- Parameters:
filter- what to set
-
setBindPoolPassivatorType
- Parameters:
type- what to set
-
setPrunePeriod
SetprunePeriod.- Parameters:
period- what to set
-
setIdleTime
SetidleTime.- Parameters:
time- what to set
-
setDnFormat
SetdnFormat.- Parameters:
format- what to set
-
setBaseDn
SetbaseDn.- Parameters:
dn- what to set
-
setUserFilter
SetuserFilter.- Parameters:
filter- what to set
-
getUserFilter
Get theuserFilter.- Returns:
- the userfilter
-
setSubtreeSearch
public void setSubtreeSearch(boolean b) SetsubtreeSearch.- Parameters:
b- what to set
-
setResolveEntryOnFailure
public void setResolveEntryOnFailure(boolean b) - Parameters:
b- what to set
-
setResolveEntryWithBindDn
public void setResolveEntryWithBindDn(boolean b) - Parameters:
b- what to set
-
setVelocityEngine
public void setVelocityEngine(org.apache.velocity.app.VelocityEngine engine) SetvelocityEngine.- Parameters:
engine- what to set
-
getVelocityEngine
@Nonnull private org.apache.velocity.app.VelocityEngine getVelocityEngine()Get thevelocityEngine.- Returns:
- the velocityEngine
-
setBindDn
SetbindDn.- Parameters:
dn- what to set
-
setBindDnCredential
SetbindDnCredential.- Parameters:
credential- what to set
-
setUsePasswordPolicy
public void setUsePasswordPolicy(boolean b) - Parameters:
b- what to set
-
setUsePasswordExpiration
public void setUsePasswordExpiration(boolean b) - Parameters:
b- what to set
-
setActiveDirectory
public void setActiveDirectory(boolean b) SetisActiveDirectory.- Parameters:
b- what to set
-
setFreeIPA
public void setFreeIPA(boolean b) SetisFreeIPA.- Parameters:
b- what to set
-
setEDirectory
public void setEDirectory(boolean b) SetisEDirectory.- Parameters:
b- what to set
-
setAccountStateExpirationPeriod
- Parameters:
period- what to set
-
setAccountStateWarningPeriod
- Parameters:
period- what to set
-
setAccountStateLoginFailures
public void setAccountStateLoginFailures(int loginFailures) - Parameters:
loginFailures- what to set
-
createSslConfig
Returns a new SslConfig object derived from the configuredtrustType. Default uses JVM trust.- Returns:
- new SslConfig
-
createConnectionConfig
Returns a new ConnectionConfig without a connection initializer.- Returns:
- new ConnectionConfig
-
createConnectionConfig
Returns a new ConnectionConfig with the supplied connection initializer.- Parameters:
initializer- to configure or null- Returns:
- new ConnectionConfig
-
createPooledConnectionFactory
protected PooledConnectionFactory createPooledConnectionFactory(String name, ConnectionConfig config) Returns a new pooled connection factory. Wires aSearchConnectionValidatorby default.- Parameters:
name- of the connection poolconfig- to assign to the pool- Returns:
- new blocking connection pool
-
createPooledConnectionFactory
protected PooledConnectionFactory createPooledConnectionFactory(String name, ConnectionConfig config, SearchConnectionValidator validator) Returns a new pooled connection factory using the supplied search validator.- Parameters:
name- of the connection poolconfig- to assign to the poolvalidator- pool validator- Returns:
- new blocking connection pool
-
createPooledConnectionFactory
protected PooledConnectionFactory createPooledConnectionFactory(String name, ConnectionConfig config, SearchConnectionValidator validator, ConnectionPassivator passivator) Returns a new pooled connection factory using the supplied search validator and passivator. Note that aLDAPAuthenticationFactoryBean.PassivatorType.BINDuses the configuredbindDnandbindDnCredential.- Parameters:
name- of the connection poolconfig- to assign to the poolvalidator- pool validatorpassivator- pool passivator- Returns:
- new blocking connection pool
-
createSearchConnectionValidator
@Nonnull protected SearchConnectionValidator createSearchConnectionValidator(@Nullable String baseDn, @Nullable String filter) CreateSearchConnectionValidator.- Parameters:
baseDn- base DNfilter- search filter- Returns:
- the validator
-
createConnectionPassivator
@Nullable protected ConnectionPassivator createConnectionPassivator(@Nonnull LDAPAuthenticationFactoryBean.PassivatorType type) CreatesConnectionPassivatorobject.- Parameters:
type- type to create- Returns:
- the created object
-
createInstance
- Specified by:
createInstancein classAbstractFactoryBean<Authenticator>- Throws:
Exception
-
destroyInstance
- Overrides:
destroyInstancein classAbstractFactoryBean<Authenticator>
-
toString
-
getObjectType
- Specified by:
getObjectTypein interfaceFactoryBean<Authenticator>- Specified by:
getObjectTypein classAbstractFactoryBean<Authenticator>
-