Class EmbeddedLdapServerContextSourceFactoryBean
java.lang.Object
org.springframework.security.config.ldap.EmbeddedLdapServerContextSourceFactoryBean
- All Implemented Interfaces:
- org.springframework.beans.factory.Aware,- org.springframework.beans.factory.DisposableBean,- org.springframework.beans.factory.FactoryBean<DefaultSpringSecurityContextSource>,- org.springframework.context.ApplicationContextAware
public class EmbeddedLdapServerContextSourceFactoryBean
extends Object
implements org.springframework.beans.factory.FactoryBean<DefaultSpringSecurityContextSource>, org.springframework.beans.factory.DisposableBean, org.springframework.context.ApplicationContextAware
Creates a 
DefaultSpringSecurityContextSource used to perform LDAP
 authentication and starts and in-memory LDAP server.- Since:
- 5.7
- 
Field SummaryFields inherited from interface org.springframework.beans.factory.FactoryBeanOBJECT_TYPE_ATTRIBUTE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoiddestroy()Create an EmbeddedLdapServerContextSourceFactoryBean that will use an embedded LDAP server to perform LDAP authentication.Class<?>voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidSpecifies an LDIF to load at startup for an embedded LDAP server.voidsetManagerDn(String managerDn) Username (DN) of the "manager" user identity (i.e.voidsetManagerPassword(String managerPassword) The password for the manager DN.voidsetPort(int port) The port to connect to LDAP to (the default is 33389 or random available port if unavailable).voidOptional root suffix for the embedded LDAP server.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.beans.factory.FactoryBeanisSingleton
- 
Constructor Details- 
EmbeddedLdapServerContextSourceFactoryBeanpublic EmbeddedLdapServerContextSourceFactoryBean()
 
- 
- 
Method Details- 
fromEmbeddedLdapServerCreate an EmbeddedLdapServerContextSourceFactoryBean that will use an embedded LDAP server to perform LDAP authentication. This requires a dependency on `com.unboundid:unboundid-ldapsdk`.- Returns:
- the EmbeddedLdapServerContextSourceFactoryBean
 
- 
setLdifSpecifies an LDIF to load at startup for an embedded LDAP server. The default is "classpath*:*.ldif".- Parameters:
- ldif- the ldif to load at startup for an embedded LDAP server.
 
- 
setPortpublic void setPort(int port) The port to connect to LDAP to (the default is 33389 or random available port if unavailable). Supplying 0 as the port indicates that a random available port should be selected.- Parameters:
- port- the port to connect to
 
- 
setRootOptional root suffix for the embedded LDAP server. Default is "dc=springframework,dc=org".- Parameters:
- root- root suffix for the embedded LDAP server
 
- 
setManagerDnUsername (DN) of the "manager" user identity (i.e. "uid=admin,ou=system") which will be used to authenticate to an LDAP server. If omitted, anonymous access will be used.- Parameters:
- managerDn- the username (DN) of the "manager" user identity used to authenticate to a LDAP server.
 
- 
setManagerPasswordThe password for the manager DN. This is required if thesetManagerDn(String)is specified.- Parameters:
- managerPassword- password for the manager DN
 
- 
getObject- Specified by:
- getObjectin interface- org.springframework.beans.factory.FactoryBean<DefaultSpringSecurityContextSource>
- Throws:
- Exception
 
- 
getObjectType- Specified by:
- getObjectTypein interface- org.springframework.beans.factory.FactoryBean<DefaultSpringSecurityContextSource>
 
- 
destroypublic void destroy()- Specified by:
- destroyin interface- org.springframework.beans.factory.DisposableBean
 
- 
setApplicationContextpublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
- setApplicationContextin interface- org.springframework.context.ApplicationContextAware
- Throws:
- org.springframework.beans.BeansException
 
 
-