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 enum
Enum that defines authenticator configuration.static enum
Enum that defines LDAP connection strategy.static enum
Enum that defines an LDAP pool passivator.static enum
Enum that defines LDAP trust configuration. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Period
Authentication handler account state expiration period.private int
Authentication handler account state login failures.private Period
Authentication handler account state warning period.Type of authenticator to configure.private String
Base DN used to search for users.private String
Privileged entry used to search for users.private String
Credential for the privileged entry.Type of passivator to configure for the bind pool.private Duration
Wait time for getting a connection from the pool.Type of connection strategy to configure.private Duration
Wait time for connects.private boolean
Whether to use the allow-all hostname verifier.private boolean
Whether to disable connection pooling for both binds and searches.private String
Java format string used to construct an LDAP DN.private Duration
Time at which a connection has been idle and should be removed from the pool.private boolean
Whether to use account state data as defined by active directory diagnostic messages.private boolean
Whether to use account state data as defined by the EDirectory schema.private boolean
Whether to use account state data as defined by the FreeIPA directory schema.private String
LDAP URL.private final org.slf4j.Logger
Class logger.private int
Maximum pool size.private int
Minimum pool size.private Duration
Period at which to check and enforce the idle time.private boolean
Whether to return the LDAP entry even if the user BIND fails.private boolean
Whether to resolve the user entry with the bind credentials.private Duration
Wait time for operation responses.private boolean
Whether to use a SUBTREE search with the baseDn.private CredentialConfig
Trust configuration when using certificate based trust.private CredentialConfig
Trust configuration when using truststore based trust.Type of trust model to configure.private boolean
Whether to use the password expiration control with the BIND operation.private boolean
Whether to use the password policy control with the BIND operation.private String
LDAP filter used to search for users.private boolean
Whether to use LDAPS for connections.private boolean
Whether to use startTLS for connections.private String
DN to perform connection pool validation against.private String
Filter to execute againstvalidateDn
.private boolean
Whether to validate connections when checked out from the pool.private Duration
Period at which to validate periodically.private boolean
Whether to validate connections periodically on a background thread.private org.apache.velocity.app.VelocityEngine
Velocity engine used to materialize the LDAP filter.Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
logger
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ConnectionConfig
Returns a new ConnectionConfig without a connection initializer.protected ConnectionConfig
createConnectionConfig
(ConnectionInitializer initializer) Returns a new ConnectionConfig with the supplied connection initializer.protected BlockingConnectionPool
createConnectionPool
(String name, ConnectionConfig config) Returns a new blocking connection pool.protected BlockingConnectionPool
createConnectionPool
(String name, ConnectionConfig config, SearchValidator validator) Returns a new blocking connection pool using the supplied search validator.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.protected Authenticator
protected Passivator
protected SearchValidator
createSearchValidator
(String baseDn, String filter) protected SslConfig
Returns a new SslConfig object derived from the configuredtrustType
.Class<?>
void
void
setAccountStateLoginFailures
(int loginFailures) void
setAccountStateWarningPeriod
(Period period) void
setActiveDirectory
(boolean b) void
setAuthenticatorType
(String type) void
void
void
setBindDnCredential
(String credential) void
void
setBlockWaitTime
(Duration time) void
void
setConnectTimeout
(Duration timeout) void
setDisableHostnameVerification
(boolean b) void
setDisablePooling
(boolean b) void
setDnFormat
(String format) void
setEDirectory
(boolean b) void
setFreeIPA
(boolean b) void
setIdleTime
(Duration time) void
setLdapUrl
(String url) void
setMaxPoolSize
(int size) void
setMinPoolSize
(int size) void
setPrunePeriod
(Duration period) void
setResolveEntryOnFailure
(boolean b) void
setResolveEntryWithBindDn
(boolean b) void
setResponseTimeout
(Duration timeout) void
setSubtreeSearch
(boolean b) void
void
void
setTrustType
(String type) void
setUsePasswordExpiration
(boolean b) void
setUsePasswordPolicy
(boolean b) void
setUserFilter
(String filter) void
setUseSSL
(boolean b) void
setUseStartTLS
(boolean b) void
setValidateDn
(String dn) void
setValidateFilter
(String filter) void
setValidateOnCheckout
(boolean b) void
setValidatePeriod
(Duration period) void
setValidatePeriodically
(boolean b) void
setVelocityEngine
(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 aSearchValidator
by 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.BIND
uses the configuredbindDn
andbindDnCredential
.- 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:
createInstance
in classAbstractFactoryBean<Authenticator>
- Throws:
Exception
-
toString
-
getObjectType
- Specified by:
getObjectType
in interfaceFactoryBean<Authenticator>
- Specified by:
getObjectType
in classAbstractFactoryBean<Authenticator>
-