|
43 | 43 | import org.springframework.security.oauth2.server.authorization.web.authentication.JwtClientAssertionAuthenticationConverter; |
44 | 44 | import org.springframework.security.oauth2.server.authorization.web.authentication.PublicClientAuthenticationConverter; |
45 | 45 | import org.springframework.security.oauth2.server.authorization.web.authentication.X509ClientCertificateAuthenticationConverter; |
46 | | -import org.springframework.security.oauth2.server.authorization.web.util.matcher.RequestMatcherUtils; |
47 | 46 | import org.springframework.security.web.authentication.AuthenticationConverter; |
48 | 47 | import org.springframework.security.web.authentication.AuthenticationFailureHandler; |
49 | 48 | import org.springframework.security.web.authentication.AuthenticationSuccessHandler; |
50 | 49 | import org.springframework.security.web.authentication.DelegatingAuthenticationConverter; |
51 | 50 | import org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter; |
| 51 | +import org.springframework.security.web.servlet.util.matcher.PathPatternRequestMatcher; |
52 | 52 | import org.springframework.security.web.util.matcher.OrRequestMatcher; |
53 | 53 | import org.springframework.security.web.util.matcher.RequestMatcher; |
54 | 54 | import org.springframework.util.Assert; |
@@ -182,29 +182,31 @@ void init(HttpSecurity httpSecurity) { |
182 | 182 | AuthorizationServerSettings authorizationServerSettings = OAuth2ConfigurerUtils |
183 | 183 | .getAuthorizationServerSettings(httpSecurity); |
184 | 184 | String tokenEndpointUri = authorizationServerSettings.isMultipleIssuersAllowed() |
185 | | - ? RequestMatcherUtils.withMultipleIssuersPattern(authorizationServerSettings.getTokenEndpoint()) |
| 185 | + ? OAuth2ConfigurerUtils.withMultipleIssuersPattern(authorizationServerSettings.getTokenEndpoint()) |
186 | 186 | : authorizationServerSettings.getTokenEndpoint(); |
187 | 187 | String tokenIntrospectionEndpointUri = authorizationServerSettings.isMultipleIssuersAllowed() |
188 | | - ? RequestMatcherUtils |
| 188 | + ? OAuth2ConfigurerUtils |
189 | 189 | .withMultipleIssuersPattern(authorizationServerSettings.getTokenIntrospectionEndpoint()) |
190 | 190 | : authorizationServerSettings.getTokenIntrospectionEndpoint(); |
191 | 191 | String tokenRevocationEndpointUri = authorizationServerSettings.isMultipleIssuersAllowed() |
192 | | - ? RequestMatcherUtils |
| 192 | + ? OAuth2ConfigurerUtils |
193 | 193 | .withMultipleIssuersPattern(authorizationServerSettings.getTokenRevocationEndpoint()) |
194 | 194 | : authorizationServerSettings.getTokenRevocationEndpoint(); |
195 | 195 | String deviceAuthorizationEndpointUri = authorizationServerSettings.isMultipleIssuersAllowed() |
196 | | - ? RequestMatcherUtils |
| 196 | + ? OAuth2ConfigurerUtils |
197 | 197 | .withMultipleIssuersPattern(authorizationServerSettings.getDeviceAuthorizationEndpoint()) |
198 | 198 | : authorizationServerSettings.getDeviceAuthorizationEndpoint(); |
199 | 199 | String pushedAuthorizationRequestEndpointUri = authorizationServerSettings.isMultipleIssuersAllowed() |
200 | | - ? RequestMatcherUtils |
| 200 | + ? OAuth2ConfigurerUtils |
201 | 201 | .withMultipleIssuersPattern(authorizationServerSettings.getPushedAuthorizationRequestEndpoint()) |
202 | 202 | : authorizationServerSettings.getPushedAuthorizationRequestEndpoint(); |
203 | | - this.requestMatcher = new OrRequestMatcher(RequestMatcherUtils.matcher(tokenEndpointUri, HttpMethod.POST), |
204 | | - RequestMatcherUtils.matcher(tokenIntrospectionEndpointUri, HttpMethod.POST), |
205 | | - RequestMatcherUtils.matcher(tokenRevocationEndpointUri, HttpMethod.POST), |
206 | | - RequestMatcherUtils.matcher(deviceAuthorizationEndpointUri, HttpMethod.POST), |
207 | | - RequestMatcherUtils.matcher(pushedAuthorizationRequestEndpointUri, HttpMethod.POST)); |
| 203 | + this.requestMatcher = new OrRequestMatcher( |
| 204 | + PathPatternRequestMatcher.withDefaults().matcher(HttpMethod.POST, tokenEndpointUri), |
| 205 | + PathPatternRequestMatcher.withDefaults().matcher(HttpMethod.POST, tokenIntrospectionEndpointUri), |
| 206 | + PathPatternRequestMatcher.withDefaults().matcher(HttpMethod.POST, tokenRevocationEndpointUri), |
| 207 | + PathPatternRequestMatcher.withDefaults().matcher(HttpMethod.POST, deviceAuthorizationEndpointUri), |
| 208 | + PathPatternRequestMatcher.withDefaults() |
| 209 | + .matcher(HttpMethod.POST, pushedAuthorizationRequestEndpointUri)); |
208 | 210 | List<AuthenticationProvider> authenticationProviders = createDefaultAuthenticationProviders(httpSecurity); |
209 | 211 | if (!this.authenticationProviders.isEmpty()) { |
210 | 212 | authenticationProviders.addAll(0, this.authenticationProviders); |
|
0 commit comments