B - the ProviderManagerBuilder type that this is configuring.public class LdapAuthenticationProviderConfigurer<B extends ProviderManagerBuilder<B>> extends SecurityConfigurerAdapter<AuthenticationManager,B>
AuthenticationProvider in the ProviderManagerBuilder.| Modifier and Type | Class and Description |
|---|---|
class |
LdapAuthenticationProviderConfigurer.ContextSourceBuilder
Allows building a
BaseLdapPathContextSource and optionally
creating an embedded LDAP instance. |
class |
LdapAuthenticationProviderConfigurer.PasswordCompareConfigurer
Sets up Password based comparison
|
| Constructor and Description |
|---|
LdapAuthenticationProviderConfigurer() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(B builder)
Configure the
SecurityBuilder by setting the necessary properties
on the SecurityBuilder. |
LdapAuthenticationProviderConfigurer.ContextSourceBuilder |
contextSource()
Allows easily configuring of a
BaseLdapPathContextSource with
defaults pointing to an embedded LDAP server that is created. |
LdapAuthenticationProviderConfigurer<B> |
contextSource(BaseLdapPathContextSource contextSource)
Specifies the
BaseLdapPathContextSource to be used. |
LdapAuthenticationProviderConfigurer<B> |
groupRoleAttribute(String groupRoleAttribute)
Specifies the attribute name which contains the role name.
|
LdapAuthenticationProviderConfigurer<B> |
groupSearchBase(String groupSearchBase)
The search base for group membership searches.
|
LdapAuthenticationProviderConfigurer<B> |
groupSearchFilter(String groupSearchFilter)
The LDAP filter to search for groups.
|
LdapAuthenticationProviderConfigurer<B> |
ldapAuthoritiesPopulator(LdapAuthoritiesPopulator ldapAuthoritiesPopulator)
Specifies the
LdapAuthoritiesPopulator. |
LdapAuthenticationProviderConfigurer.PasswordCompareConfigurer |
passwordCompare() |
LdapAuthenticationProviderConfigurer<B> |
passwordEncoder(PasswordEncoder passwordEncoder)
Deprecated.
|
LdapAuthenticationProviderConfigurer<B> |
passwordEncoder(PasswordEncoder passwordEncoder)
Specifies the
PasswordEncoder to be used when authenticating with
password comparison. |
LdapAuthenticationProviderConfigurer<B> |
rolePrefix(String rolePrefix)
A non-empty string prefix that will be added as a prefix to the existing
roles.
|
LdapAuthenticationProviderConfigurer<B> |
userDetailsContextMapper(UserDetailsContextMapper userDetailsContextMapper)
Allows explicit customization of the loaded user object by specifying a
UserDetailsContextMapper bean which will be called with the context
information from the user's directory entry.
|
LdapAuthenticationProviderConfigurer<B> |
userDnPatterns(String... userDnPatterns)
If your users are at a fixed location in the directory (i.e.
|
LdapAuthenticationProviderConfigurer<B> |
userSearchBase(String userSearchBase)
Search base for user searches.
|
LdapAuthenticationProviderConfigurer<B> |
userSearchFilter(String userSearchFilter)
The LDAP filter used to search for users (optional).
|
LdapAuthenticationProviderConfigurer<B> |
withObjectPostProcessor(ObjectPostProcessor<?> objectPostProcessor)
Adds an
ObjectPostProcessor for this class. |
addObjectPostProcessor, and, getBuilder, init, postProcess, setBuilderpublic LdapAuthenticationProviderConfigurer()
public LdapAuthenticationProviderConfigurer<B> ldapAuthoritiesPopulator(LdapAuthoritiesPopulator ldapAuthoritiesPopulator)
LdapAuthoritiesPopulator.ldapAuthoritiesPopulator - the LdapAuthoritiesPopulator the default is DefaultLdapAuthoritiesPopulatorLdapAuthenticationProviderConfigurer for further customizationspublic LdapAuthenticationProviderConfigurer<B> withObjectPostProcessor(ObjectPostProcessor<?> objectPostProcessor)
ObjectPostProcessor for this class.objectPostProcessor - ChannelSecurityConfigurer for further customizationspublic LdapAuthenticationProviderConfigurer<B> contextSource(BaseLdapPathContextSource contextSource)
BaseLdapPathContextSource to be used. If not
specified, an embedded LDAP server will be created using
contextSource().contextSource - the BaseLdapPathContextSource to useLdapAuthenticationProviderConfigurer for further
customizationscontextSource()public LdapAuthenticationProviderConfigurer.ContextSourceBuilder contextSource()
BaseLdapPathContextSource with
defaults pointing to an embedded LDAP server that is created.LdapAuthenticationProviderConfigurer.ContextSourceBuilder for further customizationspublic LdapAuthenticationProviderConfigurer<B> passwordEncoder(PasswordEncoder passwordEncoder)
passwordEncoder(org.springframework.security.crypto.password.PasswordEncoder) insteadPasswordEncoder to be used when authenticating with
password comparison.passwordEncoder - the PasswordEncoder to useLdapAuthenticationProviderConfigurer for further customizationpublic LdapAuthenticationProviderConfigurer<B> passwordEncoder(PasswordEncoder passwordEncoder)
PasswordEncoder to be used when authenticating with
password comparison.passwordEncoder - the PasswordEncoder to useLdapAuthenticationProviderConfigurer for further customizationpublic LdapAuthenticationProviderConfigurer<B> userDnPatterns(String... userDnPatterns)
userDnPatterns - the LDAP patterns for finding the usernamesLdapAuthenticationProviderConfigurer for further customizationspublic LdapAuthenticationProviderConfigurer<B> userDetailsContextMapper(UserDetailsContextMapper userDetailsContextMapper)
userDetailsContextMapper - the UserDetailsContextMapper to useLdapAuthenticationProviderConfigurer for further
customizationsPersonContextMapper,
InetOrgPersonContextMapper,
LdapUserDetailsMapperpublic LdapAuthenticationProviderConfigurer<B> groupRoleAttribute(String groupRoleAttribute)
groupRoleAttribute - the attribute name that maps a group to a role.public LdapAuthenticationProviderConfigurer<B> groupSearchBase(String groupSearchBase)
groupSearchBase - LdapAuthenticationProviderConfigurer for further customizationspublic LdapAuthenticationProviderConfigurer<B> groupSearchFilter(String groupSearchFilter)
groupSearchFilter - the LDAP filter to search for groupsLdapAuthenticationProviderConfigurer for further customizationspublic LdapAuthenticationProviderConfigurer<B> rolePrefix(String rolePrefix)
rolePrefix - the prefix to be added to the roles that are loaded.LdapAuthenticationProviderConfigurer for further customizationsSimpleAuthorityMapper.setPrefix(String)public LdapAuthenticationProviderConfigurer<B> userSearchBase(String userSearchBase)
userSearchFilter(String).userSearchBase - search base for user searchesLdapAuthenticationProviderConfigurer for further customizationspublic LdapAuthenticationProviderConfigurer<B> userSearchFilter(String userSearchFilter)
userSearchFilter - the LDAP filter used to search for usersLdapAuthenticationProviderConfigurer for further
customizationspublic void configure(B builder) throws Exception
SecurityConfigurerSecurityBuilder by setting the necessary properties
on the SecurityBuilder.configure in interface SecurityConfigurer<AuthenticationManager,B extends ProviderManagerBuilder<B>>configure in class SecurityConfigurerAdapter<AuthenticationManager,B extends ProviderManagerBuilder<B>>Exceptionpublic LdapAuthenticationProviderConfigurer.PasswordCompareConfigurer passwordCompare()