Class UserDetailsManagerConfigurer<B extends ProviderManagerBuilder<B>,C extends UserDetailsManagerConfigurer<B,C>>
- java.lang.Object
-
- org.springframework.security.config.annotation.SecurityConfigurerAdapter<AuthenticationManager,B>
-
- org.springframework.security.config.annotation.authentication.configurers.userdetails.UserDetailsAwareConfigurer<B,U>
-
- org.springframework.security.config.annotation.authentication.configurers.userdetails.AbstractDaoAuthenticationConfigurer<B,C,U>
-
- org.springframework.security.config.annotation.authentication.configurers.userdetails.UserDetailsServiceConfigurer<B,C,UserDetailsManager>
-
- org.springframework.security.config.annotation.authentication.configurers.provisioning.UserDetailsManagerConfigurer<B,C>
-
- Type Parameters:
B
- the type of theSecurityBuilder
that is being configuredC
- the type ofUserDetailsManagerConfigurer
- All Implemented Interfaces:
SecurityConfigurer<AuthenticationManager,B>
- Direct Known Subclasses:
InMemoryUserDetailsManagerConfigurer
,JdbcUserDetailsManagerConfigurer
public class UserDetailsManagerConfigurer<B extends ProviderManagerBuilder<B>,C extends UserDetailsManagerConfigurer<B,C>> extends UserDetailsServiceConfigurer<B,C,UserDetailsManager>
Base class for populating anAuthenticationManagerBuilder
with aUserDetailsManager
.- Since:
- 3.2
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
UserDetailsManagerConfigurer.UserDetailsBuilder
Builds the user to be added.
-
Constructor Summary
Constructors Modifier Constructor Description protected
UserDetailsManagerConfigurer(UserDetailsManager userDetailsManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
initUserDetailsService()
Populates the users that have been added.UserDetailsManagerConfigurer.UserDetailsBuilder
withUser(java.lang.String username)
Allows adding a user to theUserDetailsManager
that is being created.C
withUser(User.UserBuilder userBuilder)
Allows adding a user to theUserDetailsManager
that is being created.C
withUser(UserDetails userDetails)
Allows adding a user to theUserDetailsManager
that is being created.-
Methods inherited from class org.springframework.security.config.annotation.authentication.configurers.userdetails.UserDetailsServiceConfigurer
configure
-
Methods inherited from class org.springframework.security.config.annotation.authentication.configurers.userdetails.AbstractDaoAuthenticationConfigurer
getUserDetailsService, passwordEncoder, userDetailsPasswordManager, withObjectPostProcessor
-
Methods inherited from class org.springframework.security.config.annotation.SecurityConfigurerAdapter
addObjectPostProcessor, and, getBuilder, init, postProcess, setBuilder
-
-
-
-
Constructor Detail
-
UserDetailsManagerConfigurer
protected UserDetailsManagerConfigurer(UserDetailsManager userDetailsManager)
-
-
Method Detail
-
initUserDetailsService
protected void initUserDetailsService() throws java.lang.Exception
Populates the users that have been added.- Overrides:
initUserDetailsService
in classUserDetailsServiceConfigurer<B extends ProviderManagerBuilder<B>,C extends UserDetailsManagerConfigurer<B,C>,UserDetailsManager>
- Throws:
java.lang.Exception
-
withUser
public final C withUser(UserDetails userDetails)
Allows adding a user to theUserDetailsManager
that is being created. This method can be invoked multiple times to add multiple users.- Parameters:
userDetails
- the user to add. Cannot be null.- Returns:
- the
UserDetailsManagerConfigurer.UserDetailsBuilder
for further customizations
-
withUser
public final C withUser(User.UserBuilder userBuilder)
Allows adding a user to theUserDetailsManager
that is being created. This method can be invoked multiple times to add multiple users.- Parameters:
userBuilder
- the user to add. Cannot be null.- Returns:
- the
UserDetailsManagerConfigurer.UserDetailsBuilder
for further customizations
-
withUser
public final UserDetailsManagerConfigurer.UserDetailsBuilder withUser(java.lang.String username)
Allows adding a user to theUserDetailsManager
that is being created. This method can be invoked multiple times to add multiple users.- Parameters:
username
- the username for the user being added. Cannot be null.- Returns:
- the
UserDetailsManagerConfigurer.UserDetailsBuilder
for further customizations
-
-