org.springframework.security.config.annotation.authentication.configurers.ldap
Class LdapAuthenticationProviderConfigurer.ContextSourceBuilder

java.lang.Object
  extended by org.springframework.security.config.annotation.authentication.configurers.ldap.LdapAuthenticationProviderConfigurer.ContextSourceBuilder
Enclosing class:
LdapAuthenticationProviderConfigurer<B extends ProviderManagerBuilder<B>>

public final class LdapAuthenticationProviderConfigurer.ContextSourceBuilder
extends Object

Allows building a BaseLdapPathContextSource and optionally creating an embedded LDAP instance.

Since:
3.2

Method Summary
 LdapAuthenticationProviderConfigurer<B> and()
          Gets the LdapAuthenticationProviderConfigurer for further customizations
 LdapAuthenticationProviderConfigurer.ContextSourceBuilder ldif(String ldif)
          Specifies an ldif to load at startup for an embedded LDAP server.
 LdapAuthenticationProviderConfigurer.ContextSourceBuilder managerDn(String managerDn)
          Username (DN) of the "manager" user identity (i.e.
 LdapAuthenticationProviderConfigurer.ContextSourceBuilder managerPassword(String managerPassword)
          The password for the manager DN.
 LdapAuthenticationProviderConfigurer.ContextSourceBuilder port(int port)
          The port to connect to LDAP to (the default is 33389).
 LdapAuthenticationProviderConfigurer.ContextSourceBuilder root(String root)
          Optional root suffix for the embedded LDAP server.
 LdapAuthenticationProviderConfigurer.ContextSourceBuilder url(String url)
          Specifies the ldap server URL when not using the embedded LDAP server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

ldif

public LdapAuthenticationProviderConfigurer.ContextSourceBuilder ldif(String ldif)
Specifies an ldif to load at startup for an embedded LDAP server. This only loads if using an embedded instance. The default is "classpath*:*.ldif".

Parameters:
ldif - the ldif to load at startup for an embedded LDAP server.
Returns:
the LdapAuthenticationProviderConfigurer.ContextSourceBuilder for further customization

managerDn

public LdapAuthenticationProviderConfigurer.ContextSourceBuilder managerDn(String managerDn)
Username (DN) of the "manager" user identity (i.e. "uid=admin,ou=system") which will be used to authenticate to a (non-embedded) 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.
Returns:
the LdapAuthenticationProviderConfigurer.ContextSourceBuilder for further customization

managerPassword

public LdapAuthenticationProviderConfigurer.ContextSourceBuilder managerPassword(String managerPassword)
The password for the manager DN. This is required if the manager-dn is specified.

Parameters:
managerPassword - password for the manager DN
Returns:
the LdapAuthenticationProviderConfigurer.ContextSourceBuilder for further customization

port

public LdapAuthenticationProviderConfigurer.ContextSourceBuilder port(int port)
The port to connect to LDAP to (the default is 33389).

Parameters:
port - the port to connect to
Returns:
the LdapAuthenticationProviderConfigurer.ContextSourceBuilder for further customization

root

public LdapAuthenticationProviderConfigurer.ContextSourceBuilder root(String root)
Optional root suffix for the embedded LDAP server. Default is "dc=springframework,dc=org"

Parameters:
root - root suffix for the embedded LDAP server
Returns:
the LdapAuthenticationProviderConfigurer.ContextSourceBuilder for further customization

url

public LdapAuthenticationProviderConfigurer.ContextSourceBuilder url(String url)
Specifies the ldap server URL when not using the embedded LDAP server. For example, "ldaps://ldap.example.com:33389/dc=myco,dc=org".

Parameters:
url - the ldap server URL
Returns:
the LdapAuthenticationProviderConfigurer.ContextSourceBuilder for further customization

and

public LdapAuthenticationProviderConfigurer<B> and()
Gets the LdapAuthenticationProviderConfigurer for further customizations

Returns:
the LdapAuthenticationProviderConfigurer for further customizations