Class LdapAuthenticationProviderConfigurer.ContextSourceBuilder
- java.lang.Object
-
- org.springframework.security.config.annotation.authentication.configurers.ldap.LdapAuthenticationProviderConfigurer.ContextSourceBuilder
-
- Enclosing class:
- LdapAuthenticationProviderConfigurer<B extends ProviderManagerBuilder<B>>
public final class LdapAuthenticationProviderConfigurer.ContextSourceBuilder extends java.lang.ObjectAllows building aBaseLdapPathContextSourceand optionally creating an embedded LDAP instance.- Since:
- 3.2
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LdapAuthenticationProviderConfigurer<B>and()Gets theLdapAuthenticationProviderConfigurerfor further customizationsLdapAuthenticationProviderConfigurer.ContextSourceBuilderldif(java.lang.String ldif)Specifies an ldif to load at startup for an embedded LDAP server.LdapAuthenticationProviderConfigurer.ContextSourceBuildermanagerDn(java.lang.String managerDn)Username (DN) of the "manager" user identity (i.e.LdapAuthenticationProviderConfigurer.ContextSourceBuildermanagerPassword(java.lang.String managerPassword)The password for the manager DN.LdapAuthenticationProviderConfigurer.ContextSourceBuilderport(int port)The port to connect to LDAP to (the default is 33389 or random available port if unavailable).LdapAuthenticationProviderConfigurer.ContextSourceBuilderroot(java.lang.String root)Optional root suffix for the embedded LDAP server.LdapAuthenticationProviderConfigurer.ContextSourceBuilderurl(java.lang.String url)Specifies the ldap server URL when not using the embedded LDAP server.
-
-
-
Method Detail
-
ldif
public LdapAuthenticationProviderConfigurer.ContextSourceBuilder ldif(java.lang.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.ContextSourceBuilderfor further customization
-
managerDn
public LdapAuthenticationProviderConfigurer.ContextSourceBuilder managerDn(java.lang.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.ContextSourceBuilderfor further customization
-
managerPassword
public LdapAuthenticationProviderConfigurer.ContextSourceBuilder managerPassword(java.lang.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.ContextSourceBuilderfor further customization
-
port
public LdapAuthenticationProviderConfigurer.ContextSourceBuilder port(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- Returns:
- the
LdapAuthenticationProviderConfigurer.ContextSourceBuilderfor further customization
-
root
public LdapAuthenticationProviderConfigurer.ContextSourceBuilder root(java.lang.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.ContextSourceBuilderfor further customization
-
url
public LdapAuthenticationProviderConfigurer.ContextSourceBuilder url(java.lang.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.ContextSourceBuilderfor further customization
-
and
public LdapAuthenticationProviderConfigurer<B> and()
Gets theLdapAuthenticationProviderConfigurerfor further customizations- Returns:
- the
LdapAuthenticationProviderConfigurerfor further customizations
-
-