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 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 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 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 LDAPS for connections.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 BlockingConnectionPoolcreateConnectionPool(String name, ConnectionConfig config) Returns a new blocking connection pool.protected BlockingConnectionPoolcreateConnectionPool(String name, ConnectionConfig config, SearchValidator validator) Returns a new blocking connection pool using the supplied search validator.protected BlockingConnectionPoolcreateConnectionPool(String name, ConnectionConfig config, SearchValidator validator, Passivator passivator) Returns a new blocking connection pool using the supplied search validator and passivator type.protected Authenticatorprotected Passivatorprotected SearchValidatorcreateSearchValidator(String baseDn, String filter) protected SslConfigReturns a new SslConfig object derived from the configuredtrustType.Class<?>voidvoidsetAccountStateLoginFailures(int loginFailures) voidsetAccountStateWarningPeriod(Period period) voidsetActiveDirectory(boolean b) voidsetAuthenticatorType(String type) voidvoidvoidsetBindDnCredential(String credential) voidvoidsetBlockWaitTime(Duration time) voidvoidsetConnectTimeout(Duration timeout) voidsetDisableHostnameVerification(boolean b) voidsetDisablePooling(boolean b) voidsetDnFormat(String format) voidsetEDirectory(boolean b) voidsetFreeIPA(boolean b) voidsetIdleTime(Duration time) voidsetLdapUrl(String url) voidsetMaxPoolSize(int size) voidsetMinPoolSize(int size) voidsetPrunePeriod(Duration period) voidsetResolveEntryOnFailure(boolean b) voidsetResolveEntryWithBindDn(boolean b) voidsetResponseTimeout(Duration timeout) voidsetSubtreeSearch(boolean b) voidvoidvoidsetTrustType(String type) voidsetUsePasswordExpiration(boolean b) voidsetUsePasswordPolicy(boolean b) voidsetUserFilter(String filter) voidsetUseSSL(boolean b) voidsetUseStartTLS(boolean b) voidsetValidateDn(String dn) voidsetValidateFilter(String filter) voidsetValidateOnCheckout(boolean b) voidsetValidatePeriod(Duration period) voidsetValidatePeriodically(boolean b) voidsetVelocityEngine(org.apache.velocity.app.VelocityEngine engine) toString()Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, destroyInstance, 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. -
useSSL
private boolean useSSLWhether to use LDAPS for connections. -
disableHostnameVerification
private boolean disableHostnameVerificationWhether to use the allow-all hostname verifier. -
connectTimeout
Wait time for connects. -
responseTimeout
Wait time for operation responses. -
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
-
setTrustType
-
setConnectionStrategyType
-
setLdapUrl
-
setUseStartTLS
public void setUseStartTLS(boolean b) -
setUseSSL
public void setUseSSL(boolean b) -
setDisableHostnameVerification
public void setDisableHostnameVerification(boolean b) -
setConnectTimeout
-
setResponseTimeout
-
setTrustCertificatesCredentialConfig
-
setTruststoreCredentialConfig
-
setDisablePooling
public void setDisablePooling(boolean b) -
setBlockWaitTime
-
setMinPoolSize
public void setMinPoolSize(int size) -
setMaxPoolSize
public void setMaxPoolSize(int size) -
setValidateOnCheckout
public void setValidateOnCheckout(boolean b) -
setValidatePeriodically
public void setValidatePeriodically(boolean b) -
setValidatePeriod
-
setValidateDn
-
setValidateFilter
-
setBindPoolPassivatorType
-
setPrunePeriod
-
setIdleTime
-
setDnFormat
-
setBaseDn
-
setUserFilter
-
setSubtreeSearch
public void setSubtreeSearch(boolean b) -
setResolveEntryOnFailure
public void setResolveEntryOnFailure(boolean b) -
setResolveEntryWithBindDn
public void setResolveEntryWithBindDn(boolean b) -
setVelocityEngine
public void setVelocityEngine(org.apache.velocity.app.VelocityEngine engine) -
setBindDn
-
setBindDnCredential
-
setUsePasswordPolicy
public void setUsePasswordPolicy(boolean b) -
setUsePasswordExpiration
public void setUsePasswordExpiration(boolean b) -
setActiveDirectory
public void setActiveDirectory(boolean b) -
setFreeIPA
public void setFreeIPA(boolean b) -
setEDirectory
public void setEDirectory(boolean b) -
setAccountStateExpirationPeriod
-
setAccountStateWarningPeriod
-
setAccountStateLoginFailures
public void setAccountStateLoginFailures(int loginFailures) -
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
-
createConnectionPool
Returns a new blocking connection pool. Wires aSearchValidatorby default.- Parameters:
name- of the connection poolconfig- to assign to the pool- Returns:
- new blocking connection pool
-
createConnectionPool
protected BlockingConnectionPool createConnectionPool(String name, ConnectionConfig config, SearchValidator validator) Returns a new blocking connection pool using the supplied search validator.- Parameters:
name- of the connection poolconfig- to assign to the poolvalidator- pool validator- Returns:
- new blocking connection pool
-
createConnectionPool
protected BlockingConnectionPool createConnectionPool(String name, ConnectionConfig config, SearchValidator validator, Passivator passivator) Returns a new blocking connection pool using the supplied search validator and passivator type. 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
-
createSearchValidator
-
createPoolPassivator
-
createInstance
- Specified by:
createInstancein classAbstractFactoryBean<Authenticator>- Throws:
Exception
-
toString
-
getObjectType
- Specified by:
getObjectTypein interfaceFactoryBean<Authenticator>- Specified by:
getObjectTypein classAbstractFactoryBean<Authenticator>
-