|
@@ -39,7 +39,6 @@ import org.springframework.security.oauth2.core.OAuth2AuthenticationException;
|
|
import org.springframework.security.oauth2.core.OAuth2Error;
|
|
import org.springframework.security.oauth2.core.OAuth2Error;
|
|
import org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationResponse;
|
|
import org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationResponse;
|
|
import org.springframework.security.oauth2.core.endpoint.OAuth2ParameterNames;
|
|
import org.springframework.security.oauth2.core.endpoint.OAuth2ParameterNames;
|
|
-import org.springframework.security.oauth2.core.oidc.OidcScopes;
|
|
|
|
import org.springframework.security.oauth2.server.authorization.authentication.OAuth2AuthorizationCodeRequestAuthenticationException;
|
|
import org.springframework.security.oauth2.server.authorization.authentication.OAuth2AuthorizationCodeRequestAuthenticationException;
|
|
import org.springframework.security.oauth2.server.authorization.authentication.OAuth2AuthorizationCodeRequestAuthenticationProvider;
|
|
import org.springframework.security.oauth2.server.authorization.authentication.OAuth2AuthorizationCodeRequestAuthenticationProvider;
|
|
import org.springframework.security.oauth2.server.authorization.authentication.OAuth2AuthorizationCodeRequestAuthenticationToken;
|
|
import org.springframework.security.oauth2.server.authorization.authentication.OAuth2AuthorizationCodeRequestAuthenticationToken;
|
|
@@ -151,16 +150,12 @@ public final class OAuth2AuthorizationEndpointFilter extends OncePerRequestFilte
|
|
HttpMethod.GET.name());
|
|
HttpMethod.GET.name());
|
|
RequestMatcher authorizationRequestPostMatcher = new AntPathRequestMatcher(authorizationEndpointUri,
|
|
RequestMatcher authorizationRequestPostMatcher = new AntPathRequestMatcher(authorizationEndpointUri,
|
|
HttpMethod.POST.name());
|
|
HttpMethod.POST.name());
|
|
- RequestMatcher openidScopeMatcher = (request) -> {
|
|
|
|
- String scope = request.getParameter(OAuth2ParameterNames.SCOPE);
|
|
|
|
- return StringUtils.hasText(scope) && scope.contains(OidcScopes.OPENID);
|
|
|
|
- };
|
|
|
|
|
|
+
|
|
RequestMatcher responseTypeParameterMatcher = (
|
|
RequestMatcher responseTypeParameterMatcher = (
|
|
request) -> request.getParameter(OAuth2ParameterNames.RESPONSE_TYPE) != null;
|
|
request) -> request.getParameter(OAuth2ParameterNames.RESPONSE_TYPE) != null;
|
|
|
|
|
|
RequestMatcher authorizationRequestMatcher = new OrRequestMatcher(authorizationRequestGetMatcher,
|
|
RequestMatcher authorizationRequestMatcher = new OrRequestMatcher(authorizationRequestGetMatcher,
|
|
- new AndRequestMatcher(authorizationRequestPostMatcher, responseTypeParameterMatcher,
|
|
|
|
- openidScopeMatcher));
|
|
|
|
|
|
+ new AndRequestMatcher(authorizationRequestPostMatcher, responseTypeParameterMatcher));
|
|
RequestMatcher authorizationConsentMatcher = new AndRequestMatcher(authorizationRequestPostMatcher,
|
|
RequestMatcher authorizationConsentMatcher = new AndRequestMatcher(authorizationRequestPostMatcher,
|
|
new NegatedRequestMatcher(responseTypeParameterMatcher));
|
|
new NegatedRequestMatcher(responseTypeParameterMatcher));
|
|
|
|
|