See gh-12812
This commit is contained in:
Johnny Lim
2018-04-10 14:13:37 +09:00
committed by Stephane Nicoll
parent a9020df9b9
commit f03849d502
16 changed files with 25 additions and 34 deletions

View File

@@ -116,15 +116,14 @@ public class SampleSecureWebFluxCustomSecurityTests {
@Bean
public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
http.authorizeExchange().matchers(EndpointRequest.to("health", "info"))
return http.authorizeExchange().matchers(EndpointRequest.to("health", "info"))
.permitAll()
.matchers(EndpointRequest.toAnyEndpoint()
.excluding(MappingsEndpoint.class))
.hasRole("ACTUATOR")
.matchers(PathRequest.toStaticResources().atCommonLocations())
.permitAll().pathMatchers("/login").permitAll().anyExchange()
.authenticated().and().httpBasic();
return http.build();
.authenticated().and().httpBasic().and().build();
}
}