WebFluxSecurityConfiguration defaults HTTP Basic
Fixes gh-4346
This commit is contained in:
parent
1cec497a50
commit
247635ed92
|
@ -62,6 +62,7 @@ public class WebFluxSecurityConfiguration implements WebFluxConfigurer {
|
|||
@Bean
|
||||
public HttpSecurity httpSecurity() {
|
||||
HttpSecurity http = http();
|
||||
http.httpBasic();
|
||||
http.authenticationManager(authenticationManager());
|
||||
http.securityContextRepository(new WebSessionSecurityContextRepository());
|
||||
return http;
|
||||
|
|
|
@ -96,6 +96,12 @@ public class HttpSecurity {
|
|||
.flatMap( r -> Optional.of(new SecurityContextRepositoryWebFilter(r)));
|
||||
}
|
||||
|
||||
public class HttpBasicSpec extends HttpBasicBuilder {
|
||||
public HttpSecurity disable() {
|
||||
httpBasic = null;
|
||||
return HttpSecurity.this;
|
||||
}
|
||||
}
|
||||
|
||||
private HttpSecurity() {}
|
||||
}
|
||||
|
|
|
@ -36,8 +36,6 @@ public class SecurityConfig {
|
|||
|
||||
@Bean
|
||||
WebFilter springSecurityFilterChain(HttpSecurity http) throws Exception {
|
||||
http.httpBasic();
|
||||
|
||||
http.authorizeExchange()
|
||||
.antMatchers("/admin/**").hasRole("ADMIN")
|
||||
.antMatchers("/users/{user}/**").access(this::currentUserMatchesPath)
|
||||
|
|
|
@ -36,8 +36,6 @@ public class SecurityConfig {
|
|||
|
||||
@Bean
|
||||
WebFilter springSecurityFilterChain(HttpSecurity http) throws Exception {
|
||||
http.httpBasic();
|
||||
|
||||
http.authorizeExchange()
|
||||
.antMatchers("/admin/**").hasRole("ADMIN")
|
||||
.antMatchers("/users/{user}/**").access(this::currentUserMatchesPath)
|
||||
|
|
Loading…
Reference in New Issue