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 |
|---|---|
LdapAuthenticationProviderConfigurer<B> |
authoritiesMapper(GrantedAuthoritiesMapper grantedAuthoritiesMapper)
Specifies the
GrantedAuthoritiesMapper. |
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(org.springframework.ldap.core.support.BaseLdapPathContextSource contextSource)
Specifies the
BaseLdapPathContextSource to be used. |
protected GrantedAuthoritiesMapper |
getAuthoritiesMapper()
Gets the
GrantedAuthoritiesMapper and defaults to SimpleAuthorityMapper. |
LdapAuthenticationProviderConfigurer<B> |
groupRoleAttribute(java.lang.String groupRoleAttribute)
Specifies the attribute name which contains the role name.
|
LdapAuthenticationProviderConfigurer<B> |
groupSearchBase(java.lang.String groupSearchBase)
The search base for group membership searches.
|
LdapAuthenticationProviderConfigurer<B> |
groupSearchFilter(java.lang.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(java.lang.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(java.lang.String... userDnPatterns)
If your users are at a fixed location in the directory (i.e.
|
LdapAuthenticationProviderConfigurer<B> |
userSearchBase(java.lang.String userSearchBase)
Search base for user searches.
|
LdapAuthenticationProviderConfigurer<B> |
userSearchFilter(java.lang.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> authoritiesMapper(GrantedAuthoritiesMapper grantedAuthoritiesMapper)
GrantedAuthoritiesMapper.grantedAuthoritiesMapper - the GrantedAuthoritiesMapper the default is SimpleAuthorityMapperLdapAuthenticationProviderConfigurer for further customizationsprotected GrantedAuthoritiesMapper getAuthoritiesMapper() throws java.lang.Exception
GrantedAuthoritiesMapper and defaults to SimpleAuthorityMapper.GrantedAuthoritiesMapperjava.lang.Exception - if errors in SimpleAuthorityMapper.afterPropertiesSet()public LdapAuthenticationProviderConfigurer<B> contextSource(org.springframework.ldap.core.support.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(java.lang.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(java.lang.String groupRoleAttribute)
groupRoleAttribute - the attribute name that maps a group to a role.public LdapAuthenticationProviderConfigurer<B> groupSearchBase(java.lang.String groupSearchBase)
groupSearchBase - LdapAuthenticationProviderConfigurer for further customizationspublic LdapAuthenticationProviderConfigurer<B> groupSearchFilter(java.lang.String groupSearchFilter)
groupSearchFilter - the LDAP filter to search for groupsLdapAuthenticationProviderConfigurer for further customizationspublic LdapAuthenticationProviderConfigurer<B> rolePrefix(java.lang.String rolePrefix)
rolePrefix - the prefix to be added to the roles that are loaded.LdapAuthenticationProviderConfigurer for further customizationsSimpleAuthorityMapper.setPrefix(String)public LdapAuthenticationProviderConfigurer<B> userSearchBase(java.lang.String userSearchBase)
userSearchFilter(String).userSearchBase - search base for user searchesLdapAuthenticationProviderConfigurer for further customizationspublic LdapAuthenticationProviderConfigurer<B> userSearchFilter(java.lang.String userSearchFilter)
userSearchFilter - the LDAP filter used to search for usersLdapAuthenticationProviderConfigurer for further customizationspublic void configure(B builder) throws java.lang.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>>java.lang.Exceptionpublic LdapAuthenticationProviderConfigurer.PasswordCompareConfigurer passwordCompare()