Add Multiple Reactive HttpSecurity
Fixes gh-4395
This commit is contained in:
@@ -26,7 +26,7 @@ import org.springframework.security.config.web.server.HttpSecurity;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.userdetails.User;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.web.server.WebFilterChainFilter;
|
||||
import org.springframework.security.web.server.SecurityWebFilterChain;
|
||||
import org.springframework.security.web.server.authorization.AuthorizationContext;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
@@ -38,7 +38,7 @@ import reactor.core.publisher.Mono;
|
||||
public class SecurityConfig {
|
||||
|
||||
@Bean
|
||||
WebFilterChainFilter springSecurityFilterChain(HttpSecurity http) throws Exception {
|
||||
SecurityWebFilterChain springWebFilterChain(HttpSecurity http) throws Exception {
|
||||
http.authorizeExchange()
|
||||
.pathMatchers("/admin/**").hasRole("ADMIN")
|
||||
.pathMatchers("/users/{user}/**").access(this::currentUserMatchesPath)
|
||||
|
||||
Reference in New Issue
Block a user