mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-28 14:52:24 +00:00
Revert OAuth2AuthorizationCodeGrantWebFilter works with /{action}/
Issue #5856 Commit 385bdfc055854581e9e9f671d11f86a978c27c42 NOTE: This commit 'partially' reverts #5856. Only the ServerWebExchangeMatcher for OAuth2LoginSpec is reverted. Fixes gh-6890
This commit is contained in:
parent
efe64aa7d9
commit
b0597f45a8
@ -54,7 +54,6 @@ import org.springframework.security.authorization.AuthorizationDecision;
|
|||||||
import org.springframework.security.authorization.ReactiveAuthorizationManager;
|
import org.springframework.security.authorization.ReactiveAuthorizationManager;
|
||||||
import org.springframework.security.core.Authentication;
|
import org.springframework.security.core.Authentication;
|
||||||
import org.springframework.security.core.AuthenticationException;
|
import org.springframework.security.core.AuthenticationException;
|
||||||
import org.springframework.security.core.context.ReactiveSecurityContextHolder;
|
|
||||||
import org.springframework.security.oauth2.client.InMemoryReactiveOAuth2AuthorizedClientService;
|
import org.springframework.security.oauth2.client.InMemoryReactiveOAuth2AuthorizedClientService;
|
||||||
import org.springframework.security.oauth2.client.ReactiveOAuth2AuthorizedClientService;
|
import org.springframework.security.oauth2.client.ReactiveOAuth2AuthorizedClientService;
|
||||||
import org.springframework.security.oauth2.client.authentication.OAuth2AuthorizationCodeReactiveAuthenticationManager;
|
import org.springframework.security.oauth2.client.authentication.OAuth2AuthorizationCodeReactiveAuthenticationManager;
|
||||||
@ -647,11 +646,7 @@ public class ServerHttpSecurity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private ServerWebExchangeMatcher createAttemptAuthenticationRequestMatcher() {
|
private ServerWebExchangeMatcher createAttemptAuthenticationRequestMatcher() {
|
||||||
PathPatternParserServerWebExchangeMatcher loginPathMatcher = new PathPatternParserServerWebExchangeMatcher("/login/oauth2/code/{registrationId}");
|
return new PathPatternParserServerWebExchangeMatcher("/login/oauth2/code/{registrationId}");
|
||||||
ServerWebExchangeMatcher notAuthenticatedMatcher = e -> ReactiveSecurityContextHolder.getContext()
|
|
||||||
.flatMap(p -> ServerWebExchangeMatcher.MatchResult.notMatch())
|
|
||||||
.switchIfEmpty(ServerWebExchangeMatcher.MatchResult.match());
|
|
||||||
return new AndServerWebExchangeMatcher(loginPathMatcher, notAuthenticatedMatcher);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ReactiveOAuth2UserService<OidcUserRequest, OidcUser> getOidcUserService() {
|
private ReactiveOAuth2UserService<OidcUserRequest, OidcUser> getOidcUserService() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user