use of org.springframework.security.core.userdetails.MapReactiveUserDetailsService in project tutorials by eugenp.
the class SecurityConfig method userDetailsService.
@Bean
public MapReactiveUserDetailsService userDetailsService() {
UserDetails user = User.withDefaultPasswordEncoder().username("user").password("password").roles("USER").build();
UserDetails admin = User.withDefaultPasswordEncoder().username("admin").password("password").roles("ADMIN").build();
return new MapReactiveUserDetailsService(user, admin);
}
use of org.springframework.security.core.userdetails.MapReactiveUserDetailsService in project spring-boot by spring-projects.
the class ReactiveUserDetailsServiceAutoConfiguration method reactiveUserDetailsService.
@Bean
public MapReactiveUserDetailsService reactiveUserDetailsService(SecurityProperties properties, ObjectProvider<PasswordEncoder> passwordEncoder) {
SecurityProperties.User user = properties.getUser();
UserDetails userDetails = getUserDetails(user, getOrDeducePassword(user, passwordEncoder.getIfAvailable()));
return new MapReactiveUserDetailsService(userDetails);
}
Aggregations