Class AbstractUserDetailsReactiveAuthenticationManager
- java.lang.Object
- 
- org.springframework.security.authentication.AbstractUserDetailsReactiveAuthenticationManager
 
- 
- All Implemented Interfaces:
- org.springframework.beans.factory.Aware,- org.springframework.context.MessageSourceAware,- ReactiveAuthenticationManager
 - Direct Known Subclasses:
- UserDetailsRepositoryReactiveAuthenticationManager
 
 public abstract class AbstractUserDetailsReactiveAuthenticationManager extends java.lang.Object implements ReactiveAuthenticationManager, org.springframework.context.MessageSourceAware A baseReactiveAuthenticationManagerthat allows subclasses to override and work withUserDetailsobjects.Upon successful validation, a UsernamePasswordAuthenticationTokenwill be created and returned to the caller. The token will include as its principal either aStringrepresentation of the username, or theUserDetailsthat was returned from the authentication repository.- Since:
- 5.2
 
- 
- 
Constructor SummaryConstructors Constructor Description AbstractUserDetailsReactiveAuthenticationManager()
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description reactor.core.publisher.Mono<Authentication>authenticate(Authentication authentication)Attempts to authenticate the providedAuthenticationprotected abstract reactor.core.publisher.Mono<UserDetails>retrieveUser(java.lang.String username)Allows subclasses to retrieve theUserDetailsfrom an implementation-specific location.voidsetMessageSource(org.springframework.context.MessageSource messageSource)voidsetPasswordEncoder(PasswordEncoder passwordEncoder)ThePasswordEncoderthat is used for validating the password.voidsetPostAuthenticationChecks(UserDetailsChecker postAuthenticationChecks)Sets the strategy which will be used to validate the loaded UserDetails object after authentication occurs.voidsetScheduler(reactor.core.scheduler.Scheduler scheduler)Sets theSchedulerused by theUserDetailsRepositoryReactiveAuthenticationManager.voidsetUserDetailsPasswordService(ReactiveUserDetailsPasswordService userDetailsPasswordService)Sets the service to use for upgrading passwords on successful authentication.
 
- 
- 
- 
Method Detail- 
authenticatepublic reactor.core.publisher.Mono<Authentication> authenticate(Authentication authentication) Description copied from interface:ReactiveAuthenticationManagerAttempts to authenticate the providedAuthentication- Specified by:
- authenticatein interface- ReactiveAuthenticationManager
- Parameters:
- authentication- the- Authenticationto test
- Returns:
- if authentication is successful an Authenticationis returned. If authentication cannot be determined, an empty Mono is returned. If authentication fails, a Mono error is returned.
 
 - 
setPasswordEncoderpublic void setPasswordEncoder(PasswordEncoder passwordEncoder) ThePasswordEncoderthat is used for validating the password. The default isPasswordEncoderFactories.createDelegatingPasswordEncoder()- Parameters:
- passwordEncoder- the- PasswordEncoderto use. Cannot be null
 
 - 
setSchedulerpublic void setScheduler(reactor.core.scheduler.Scheduler scheduler) Sets theSchedulerused by theUserDetailsRepositoryReactiveAuthenticationManager. The default isSchedulers.newParallel(String)because modern password encoding is a CPU intensive task that is non blocking. This means validation is bounded by the number of CPUs. Some applications may want to customize theScheduler. For example, if users are stuck using the insecureNoOpPasswordEncoderthey might want to leverageSchedulers.immediate().- Parameters:
- scheduler- the- Schedulerto use. Cannot be null.
- Since:
- 5.0.6
 
 - 
setUserDetailsPasswordServicepublic void setUserDetailsPasswordService(ReactiveUserDetailsPasswordService userDetailsPasswordService) Sets the service to use for upgrading passwords on successful authentication.- Parameters:
- userDetailsPasswordService- the service to use
 
 - 
setPostAuthenticationCheckspublic void setPostAuthenticationChecks(UserDetailsChecker postAuthenticationChecks) Sets the strategy which will be used to validate the loaded UserDetails object after authentication occurs.- Parameters:
- postAuthenticationChecks- The- UserDetailsChecker
- Since:
- 5.2
 
 - 
setMessageSourcepublic void setMessageSource(org.springframework.context.MessageSource messageSource) - Specified by:
- setMessageSourcein interface- org.springframework.context.MessageSourceAware
- Since:
- 5.5
 
 - 
retrieveUserprotected abstract reactor.core.publisher.Mono<UserDetails> retrieveUser(java.lang.String username) Allows subclasses to retrieve theUserDetailsfrom an implementation-specific location.- Parameters:
- username- The username to retrieve
- Returns:
- the user information. If authentication fails, a Mono error is returned.
 
 
- 
 
-