-
Notifications
You must be signed in to change notification settings - Fork 6k
Create composite ReactiveAuthenticationManager #14521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Have you already tried |
Yes. DelegatingReactiveAuthenticationManager does not have the behavior that I need, since at the first failed authentication, flux exits. In my case, there are two authentication schemes and I need to iterate over both as in ProviderManager. There is currently no analogue of ProviderManager. |
I see. I wonder if it would be better to add a property to |
Yes, I think this solution will work. |
In general, this idea is good, but it seems to me that it is impossible to implement it in DelegatingReactiveAuthenticationManager. Method authenticate will return the first successful authentication, but the stream will not move further. That is, there can be many delegates in the list and all will be discarded except the first one, which returns a non empty result. |
If only something like this?
|
Or, another way: Flux<ReactiveAuthenticationManager> result = Flux.fromIterable(this.delegates);
Function<ReactiveAuthenticationManager, Mono<Authentication>> logging =
(m) -> m.authenticate(authentication).doOnError(logger::debug);
return ((this.continueOnError) ? result.concatMapDelayError(logging) : result.concatMap(logging)).next(); |
Ok, I have opened a new PR. |
…as been marked as non-static, setter method has been added for continueOnError flag, test have been refactored. Closes spring-projectsgh-14521
Need to make a composite ReactiveAuthenticationManager, for example CompositeReactiveAuthenticationManager, which contains a list of managers. The behavior should be approximately the same as that of ProviderManager - you need to iterate all the managers and use the first of the successful authentications as a result.
The text was updated successfully, but these errors were encountered: