@ -67,8 +67,6 @@ public class ServerHttpSecurityConfiguration implements WebFluxConfigurer {
return http()
.authenticationManager(authenticationManager())
.headers().and()
.httpBasic().and()
.formLogin().and()
.logout().and();
}
@ -65,7 +65,11 @@ public class WebFluxSecurityConfiguration {
ServerHttpSecurity http = context.getBean(ServerHttpSecurity.class);
http
.authorizeExchange()
.anyExchange().authenticated();
.anyExchange().authenticated()
.and()
.build();
return Arrays.asList(http.build());
@ -43,6 +43,7 @@ public class LogoutBuilderTests {
WebTestClient webTestClient = WebTestClientBuilder
@ -82,6 +83,7 @@ public class LogoutBuilderTests {
.logout()
.logoutUrl("/custom-logout")
@ -36,10 +36,12 @@ public class SecurityConfig {
@Bean
SecurityWebFilterChain springWebFilterChain(ServerHttpSecurity http) throws Exception {
return http
// we rely on method security
// Demonstrate that method security works
// Best practice to use both for defense in depth
.anyExchange().permitAll()