use of org.springframework.security.core.userdetails.ReactiveUserDetailsService in project spring-security by spring-projects.
the class ServerHttpSecurityConfigurationBuilder method httpWithDefaultAuthentication.
public static ServerHttpSecurity httpWithDefaultAuthentication() {
ReactiveUserDetailsService reactiveUserDetailsService = ReactiveAuthenticationTestConfiguration.userDetailsService();
ReactiveAuthenticationManager authenticationManager = new UserDetailsRepositoryReactiveAuthenticationManager(reactiveUserDetailsService);
return http().authenticationManager(authenticationManager);
}
use of org.springframework.security.core.userdetails.ReactiveUserDetailsService in project spring-security by spring-projects.
the class EnableWebFluxSecurityTests method passwordUpdateManagerUsed.
@Test
public void passwordUpdateManagerUsed() {
this.spring.register(MapReactiveUserDetailsServiceConfig.class).autowire();
// @formatter:off
WebTestClient client = WebTestClientBuilder.bindToWebFilters(this.springSecurityFilterChain).build();
client.get().uri("/").headers((h) -> h.setBasicAuth("user", "password")).exchange().expectStatus().isOk();
// @formatter:on
ReactiveUserDetailsService users = this.spring.getContext().getBean(ReactiveUserDetailsService.class);
assertThat(users.findByUsername("user").block().getPassword()).startsWith("{bcrypt}");
}
Aggregations