ReactiveUserDetailsService is the Spring Security contract for retrieving a user by username in a reactive application. Its method returns Mono<UserDetails>, enabling asynchronous user lookup for authentication. A custom implementation can connect authentication to an application’s user store. section 17.2
public interface ReactiveUserDetailsService {
Mono<UserDetails> findByUsername(String username);
}
The interface shows the contract directly: findByUsername accepts a username and returns Mono<UserDetails>. section 17.2
In-memory reactive users
A reactive application can register MapReactiveUserDetailsService as a bean, define user john with password 12345 and authority read, and provide a PasswordEncoder. Authentication can then protect /hello, with ReactiveAuthenticationManager using the service to find the user and the encoder to verify the password. section 17.2
