Class UserDetailsServiceConfigurer<B extends ProviderManagerBuilder<B>,C extends UserDetailsServiceConfigurer<B,C,U>,U extends UserDetailsService>
- 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,U>
-
- Type Parameters:
B
- the type of theProviderManagerBuilder
C
- theUserDetailsServiceConfigurer
(or this)U
- the type of UserDetailsService being used to allow for returning the concrete UserDetailsService.
- All Implemented Interfaces:
SecurityConfigurer<AuthenticationManager,B>
- Direct Known Subclasses:
UserDetailsManagerConfigurer
public class UserDetailsServiceConfigurer<B extends ProviderManagerBuilder<B>,C extends UserDetailsServiceConfigurer<B,C,U>,U extends UserDetailsService> extends AbstractDaoAuthenticationConfigurer<B,C,U>
Allows configuring aUserDetailsService
within aAuthenticationManagerBuilder
.- Since:
- 3.2
-
-
Constructor Summary
Constructors Constructor Description UserDetailsServiceConfigurer(U userDetailsService)
Creates a new instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(B builder)
Configure theSecurityBuilder
by setting the necessary properties on theSecurityBuilder
.protected void
initUserDetailsService()
Allows subclasses to initialize theUserDetailsService
.-
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
-
UserDetailsServiceConfigurer
public UserDetailsServiceConfigurer(U userDetailsService)
Creates a new instance- Parameters:
userDetailsService
- theUserDetailsService
that should be used
-
-
Method Detail
-
configure
public void configure(B builder) throws java.lang.Exception
Description copied from interface:SecurityConfigurer
Configure theSecurityBuilder
by setting the necessary properties on theSecurityBuilder
.- Specified by:
configure
in interfaceSecurityConfigurer<B extends ProviderManagerBuilder<B>,C extends UserDetailsServiceConfigurer<B,C,U>>
- Overrides:
configure
in classAbstractDaoAuthenticationConfigurer<B extends ProviderManagerBuilder<B>,C extends UserDetailsServiceConfigurer<B,C,U>,U extends UserDetailsService>
- Throws:
java.lang.Exception
-
initUserDetailsService
protected void initUserDetailsService() throws java.lang.Exception
Allows subclasses to initialize theUserDetailsService
. For example, it might add users, initialize schema, etc.- Throws:
java.lang.Exception
-
-