|
39 | 39 | import org.springframework.security.oauth2.core.OAuth2Error;
|
40 | 40 | import org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationResponse;
|
41 | 41 | import org.springframework.security.oauth2.core.endpoint.OAuth2ParameterNames;
|
42 |
| -import org.springframework.security.oauth2.core.oidc.OidcScopes; |
43 | 42 | import org.springframework.security.oauth2.server.authorization.authentication.OAuth2AuthorizationCodeRequestAuthenticationException;
|
44 | 43 | import org.springframework.security.oauth2.server.authorization.authentication.OAuth2AuthorizationCodeRequestAuthenticationProvider;
|
45 | 44 | import org.springframework.security.oauth2.server.authorization.authentication.OAuth2AuthorizationCodeRequestAuthenticationToken;
|
|
57 | 56 | import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy;
|
58 | 57 | import org.springframework.security.web.util.RedirectUrlBuilder;
|
59 | 58 | import org.springframework.security.web.util.UrlUtils;
|
60 |
| -import org.springframework.security.web.util.matcher.AndRequestMatcher; |
61 | 59 | import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
|
62 |
| -import org.springframework.security.web.util.matcher.NegatedRequestMatcher; |
63 | 60 | import org.springframework.security.web.util.matcher.OrRequestMatcher;
|
64 | 61 | import org.springframework.security.web.util.matcher.RequestMatcher;
|
65 | 62 | import org.springframework.util.Assert;
|
@@ -151,20 +148,8 @@ private static RequestMatcher createDefaultRequestMatcher(String authorizationEn
|
151 | 148 | HttpMethod.GET.name());
|
152 | 149 | RequestMatcher authorizationRequestPostMatcher = new AntPathRequestMatcher(authorizationEndpointUri,
|
153 | 150 | HttpMethod.POST.name());
|
154 |
| - RequestMatcher openidScopeMatcher = (request) -> { |
155 |
| - String scope = request.getParameter(OAuth2ParameterNames.SCOPE); |
156 |
| - return StringUtils.hasText(scope) && scope.contains(OidcScopes.OPENID); |
157 |
| - }; |
158 |
| - RequestMatcher responseTypeParameterMatcher = ( |
159 |
| - request) -> request.getParameter(OAuth2ParameterNames.RESPONSE_TYPE) != null; |
160 |
| - |
161 |
| - RequestMatcher authorizationRequestMatcher = new OrRequestMatcher(authorizationRequestGetMatcher, |
162 |
| - new AndRequestMatcher(authorizationRequestPostMatcher, responseTypeParameterMatcher, |
163 |
| - openidScopeMatcher)); |
164 |
| - RequestMatcher authorizationConsentMatcher = new AndRequestMatcher(authorizationRequestPostMatcher, |
165 |
| - new NegatedRequestMatcher(responseTypeParameterMatcher)); |
166 |
| - |
167 |
| - return new OrRequestMatcher(authorizationRequestMatcher, authorizationConsentMatcher); |
| 151 | + |
| 152 | + return new OrRequestMatcher(authorizationRequestGetMatcher, authorizationRequestPostMatcher); |
168 | 153 | }
|
169 | 154 |
|
170 | 155 | @Override
|
|
0 commit comments