Add Multiple Reactive HttpSecurity

Fixes gh-4395
This commit is contained in:
Rob Winch
2017-06-14 14:05:52 -05:00
parent 406e1e6951
commit 9141a8a7c0
10 changed files with 281 additions and 15 deletions

View File

@@ -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)