DelegatingServerAuthenticationSuccessHandler Executes Sequentially
Fixes gh-7728
This commit is contained in:
+4
-6
@@ -19,11 +19,11 @@ package org.springframework.security.web.server.authentication;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.web.server.WebFilterExchange;
|
||||
import org.springframework.util.Assert;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Delegates to a collection of {@link ServerAuthenticationSuccessHandler} implementations.
|
||||
@@ -42,10 +42,8 @@ public class DelegatingServerAuthenticationSuccessHandler implements ServerAuthe
|
||||
@Override
|
||||
public Mono<Void> onAuthenticationSuccess(WebFilterExchange exchange,
|
||||
Authentication authentication) {
|
||||
List<Mono<Void>> results = new ArrayList<>();
|
||||
for (ServerAuthenticationSuccessHandler delegate : delegates) {
|
||||
results.add(delegate.onAuthenticationSuccess(exchange, authentication));
|
||||
}
|
||||
return Mono.when(results);
|
||||
return Flux.fromIterable(this.delegates)
|
||||
.concatMap(delegate -> delegate.onAuthenticationSuccess(exchange, authentication))
|
||||
.then();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user