Skip to content

Commit 9fa7f60

Browse files
Replacing DelegatingAuthenticationConverter with a similar from framework
1 parent 3b52e15 commit 9fa7f60

15 files changed

+21
-18
lines changed

oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/config/annotation/web/configurers/OAuth2AuthorizationEndpointConfigurer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2023 the original author or authors.
2+
* Copyright 2020-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -37,12 +37,12 @@
3737
import org.springframework.security.oauth2.server.authorization.authentication.OAuth2AuthorizationConsentAuthenticationToken;
3838
import org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings;
3939
import org.springframework.security.oauth2.server.authorization.web.OAuth2AuthorizationEndpointFilter;
40-
import org.springframework.security.oauth2.server.authorization.web.authentication.DelegatingAuthenticationConverter;
4140
import org.springframework.security.oauth2.server.authorization.web.authentication.OAuth2AuthorizationCodeRequestAuthenticationConverter;
4241
import org.springframework.security.oauth2.server.authorization.web.authentication.OAuth2AuthorizationConsentAuthenticationConverter;
4342
import org.springframework.security.web.authentication.AuthenticationConverter;
4443
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
4544
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
45+
import org.springframework.security.web.authentication.DelegatingAuthenticationConverter;
4646
import org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter;
4747
import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy;
4848
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;

oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/config/annotation/web/configurers/OAuth2ClientAuthenticationConfigurer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@
4040
import org.springframework.security.oauth2.server.authorization.web.OAuth2ClientAuthenticationFilter;
4141
import org.springframework.security.oauth2.server.authorization.web.authentication.ClientSecretBasicAuthenticationConverter;
4242
import org.springframework.security.oauth2.server.authorization.web.authentication.ClientSecretPostAuthenticationConverter;
43-
import org.springframework.security.oauth2.server.authorization.web.authentication.DelegatingAuthenticationConverter;
4443
import org.springframework.security.oauth2.server.authorization.web.authentication.JwtClientAssertionAuthenticationConverter;
4544
import org.springframework.security.oauth2.server.authorization.web.authentication.PublicClientAuthenticationConverter;
4645
import org.springframework.security.oauth2.server.authorization.web.authentication.X509ClientCertificateAuthenticationConverter;
4746
import org.springframework.security.web.authentication.AuthenticationConverter;
4847
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
4948
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
49+
import org.springframework.security.web.authentication.DelegatingAuthenticationConverter;
5050
import org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter;
5151
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
5252
import org.springframework.security.web.util.matcher.OrRequestMatcher;

oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/config/annotation/web/configurers/OAuth2DeviceAuthorizationEndpointConfigurer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@
3434
import org.springframework.security.oauth2.server.authorization.authentication.OAuth2DeviceAuthorizationRequestAuthenticationToken;
3535
import org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings;
3636
import org.springframework.security.oauth2.server.authorization.web.OAuth2DeviceAuthorizationEndpointFilter;
37-
import org.springframework.security.oauth2.server.authorization.web.authentication.DelegatingAuthenticationConverter;
3837
import org.springframework.security.oauth2.server.authorization.web.authentication.OAuth2DeviceAuthorizationRequestAuthenticationConverter;
3938
import org.springframework.security.web.access.intercept.AuthorizationFilter;
4039
import org.springframework.security.web.authentication.AuthenticationConverter;
4140
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
4241
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
42+
import org.springframework.security.web.authentication.DelegatingAuthenticationConverter;
4343
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
4444
import org.springframework.security.web.util.matcher.RequestMatcher;
4545
import org.springframework.util.Assert;

oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/config/annotation/web/configurers/OAuth2DeviceVerificationEndpointConfigurer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@
3737
import org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository;
3838
import org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings;
3939
import org.springframework.security.oauth2.server.authorization.web.OAuth2DeviceVerificationEndpointFilter;
40-
import org.springframework.security.oauth2.server.authorization.web.authentication.DelegatingAuthenticationConverter;
4140
import org.springframework.security.oauth2.server.authorization.web.authentication.OAuth2DeviceAuthorizationConsentAuthenticationConverter;
4241
import org.springframework.security.oauth2.server.authorization.web.authentication.OAuth2DeviceVerificationAuthenticationConverter;
4342
import org.springframework.security.web.authentication.AuthenticationConverter;
4443
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
4544
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
45+
import org.springframework.security.web.authentication.DelegatingAuthenticationConverter;
4646
import org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter;
4747
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
4848
import org.springframework.security.web.util.matcher.OrRequestMatcher;

oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/config/annotation/web/configurers/OAuth2TokenEndpointConfigurer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings;
4343
import org.springframework.security.oauth2.server.authorization.token.OAuth2TokenGenerator;
4444
import org.springframework.security.oauth2.server.authorization.web.OAuth2TokenEndpointFilter;
45-
import org.springframework.security.oauth2.server.authorization.web.authentication.DelegatingAuthenticationConverter;
4645
import org.springframework.security.oauth2.server.authorization.web.authentication.OAuth2AuthorizationCodeAuthenticationConverter;
4746
import org.springframework.security.oauth2.server.authorization.web.authentication.OAuth2ClientCredentialsAuthenticationConverter;
4847
import org.springframework.security.oauth2.server.authorization.web.authentication.OAuth2DeviceCodeAuthenticationConverter;
@@ -52,6 +51,7 @@
5251
import org.springframework.security.web.authentication.AuthenticationConverter;
5352
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
5453
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
54+
import org.springframework.security.web.authentication.DelegatingAuthenticationConverter;
5555
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
5656
import org.springframework.security.web.util.matcher.RequestMatcher;
5757
import org.springframework.util.Assert;

oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/config/annotation/web/configurers/OAuth2TokenIntrospectionEndpointConfigurer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@
3333
import org.springframework.security.oauth2.server.authorization.authentication.OAuth2TokenIntrospectionAuthenticationToken;
3434
import org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings;
3535
import org.springframework.security.oauth2.server.authorization.web.OAuth2TokenIntrospectionEndpointFilter;
36-
import org.springframework.security.oauth2.server.authorization.web.authentication.DelegatingAuthenticationConverter;
3736
import org.springframework.security.oauth2.server.authorization.web.authentication.OAuth2TokenIntrospectionAuthenticationConverter;
3837
import org.springframework.security.web.access.intercept.AuthorizationFilter;
3938
import org.springframework.security.web.authentication.AuthenticationConverter;
4039
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
4140
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
41+
import org.springframework.security.web.authentication.DelegatingAuthenticationConverter;
4242
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
4343
import org.springframework.security.web.util.matcher.RequestMatcher;
4444
import org.springframework.util.Assert;

oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/config/annotation/web/configurers/OAuth2TokenRevocationEndpointConfigurer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@
3232
import org.springframework.security.oauth2.server.authorization.authentication.OAuth2TokenRevocationAuthenticationToken;
3333
import org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings;
3434
import org.springframework.security.oauth2.server.authorization.web.OAuth2TokenRevocationEndpointFilter;
35-
import org.springframework.security.oauth2.server.authorization.web.authentication.DelegatingAuthenticationConverter;
3635
import org.springframework.security.oauth2.server.authorization.web.authentication.OAuth2TokenRevocationAuthenticationConverter;
3736
import org.springframework.security.web.access.intercept.AuthorizationFilter;
3837
import org.springframework.security.web.authentication.AuthenticationConverter;
3938
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
4039
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
40+
import org.springframework.security.web.authentication.DelegatingAuthenticationConverter;
4141
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
4242
import org.springframework.security.web.util.matcher.RequestMatcher;
4343
import org.springframework.util.Assert;

oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/config/annotation/web/configurers/OidcClientRegistrationEndpointConfigurer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@
3636
import org.springframework.security.oauth2.server.authorization.oidc.web.OidcClientRegistrationEndpointFilter;
3737
import org.springframework.security.oauth2.server.authorization.oidc.web.authentication.OidcClientRegistrationAuthenticationConverter;
3838
import org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings;
39-
import org.springframework.security.oauth2.server.authorization.web.authentication.DelegatingAuthenticationConverter;
4039
import org.springframework.security.web.access.intercept.AuthorizationFilter;
4140
import org.springframework.security.web.authentication.AuthenticationConverter;
4241
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
4342
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
43+
import org.springframework.security.web.authentication.DelegatingAuthenticationConverter;
4444
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
4545
import org.springframework.security.web.util.matcher.OrRequestMatcher;
4646
import org.springframework.security.web.util.matcher.RequestMatcher;

oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/config/annotation/web/configurers/OidcLogoutEndpointConfigurer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@
3434
import org.springframework.security.oauth2.server.authorization.oidc.web.OidcLogoutEndpointFilter;
3535
import org.springframework.security.oauth2.server.authorization.oidc.web.authentication.OidcLogoutAuthenticationConverter;
3636
import org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings;
37-
import org.springframework.security.oauth2.server.authorization.web.authentication.DelegatingAuthenticationConverter;
3837
import org.springframework.security.web.authentication.AuthenticationConverter;
3938
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
4039
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
40+
import org.springframework.security.web.authentication.DelegatingAuthenticationConverter;
4141
import org.springframework.security.web.authentication.logout.LogoutFilter;
4242
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
4343
import org.springframework.security.web.util.matcher.OrRequestMatcher;

oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/config/annotation/web/configurers/OidcUserInfoEndpointConfigurer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@
3939
import org.springframework.security.oauth2.server.authorization.oidc.authentication.OidcUserInfoAuthenticationToken;
4040
import org.springframework.security.oauth2.server.authorization.oidc.web.OidcUserInfoEndpointFilter;
4141
import org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings;
42-
import org.springframework.security.oauth2.server.authorization.web.authentication.DelegatingAuthenticationConverter;
4342
import org.springframework.security.web.access.intercept.AuthorizationFilter;
4443
import org.springframework.security.web.authentication.AuthenticationConverter;
4544
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
4645
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
46+
import org.springframework.security.web.authentication.DelegatingAuthenticationConverter;
4747
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
4848
import org.springframework.security.web.util.matcher.OrRequestMatcher;
4949
import org.springframework.security.web.util.matcher.RequestMatcher;

oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/web/OAuth2AuthorizationEndpointFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2023 the original author or authors.
2+
* Copyright 2020-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -45,14 +45,14 @@
4545
import org.springframework.security.oauth2.server.authorization.authentication.OAuth2AuthorizationCodeRequestAuthenticationToken;
4646
import org.springframework.security.oauth2.server.authorization.authentication.OAuth2AuthorizationConsentAuthenticationProvider;
4747
import org.springframework.security.oauth2.server.authorization.authentication.OAuth2AuthorizationConsentAuthenticationToken;
48-
import org.springframework.security.oauth2.server.authorization.web.authentication.DelegatingAuthenticationConverter;
4948
import org.springframework.security.oauth2.server.authorization.web.authentication.OAuth2AuthorizationCodeRequestAuthenticationConverter;
5049
import org.springframework.security.oauth2.server.authorization.web.authentication.OAuth2AuthorizationConsentAuthenticationConverter;
5150
import org.springframework.security.web.DefaultRedirectStrategy;
5251
import org.springframework.security.web.RedirectStrategy;
5352
import org.springframework.security.web.authentication.AuthenticationConverter;
5453
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
5554
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
55+
import org.springframework.security.web.authentication.DelegatingAuthenticationConverter;
5656
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
5757
import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy;
5858
import org.springframework.security.web.util.RedirectUrlBuilder;

oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/web/OAuth2ClientAuthenticationFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@
4545
import org.springframework.security.oauth2.server.authorization.authentication.X509ClientCertificateAuthenticationProvider;
4646
import org.springframework.security.oauth2.server.authorization.web.authentication.ClientSecretBasicAuthenticationConverter;
4747
import org.springframework.security.oauth2.server.authorization.web.authentication.ClientSecretPostAuthenticationConverter;
48-
import org.springframework.security.oauth2.server.authorization.web.authentication.DelegatingAuthenticationConverter;
4948
import org.springframework.security.oauth2.server.authorization.web.authentication.JwtClientAssertionAuthenticationConverter;
5049
import org.springframework.security.oauth2.server.authorization.web.authentication.PublicClientAuthenticationConverter;
5150
import org.springframework.security.oauth2.server.authorization.web.authentication.X509ClientCertificateAuthenticationConverter;
5251
import org.springframework.security.web.authentication.AuthenticationConverter;
5352
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
5453
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
54+
import org.springframework.security.web.authentication.DelegatingAuthenticationConverter;
5555
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
5656
import org.springframework.security.web.util.matcher.RequestMatcher;
5757
import org.springframework.util.Assert;

oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/web/OAuth2DeviceVerificationEndpointFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2023 the original author or authors.
2+
* Copyright 2020-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -41,14 +41,14 @@
4141
import org.springframework.security.oauth2.server.authorization.authentication.OAuth2DeviceAuthorizationConsentAuthenticationToken;
4242
import org.springframework.security.oauth2.server.authorization.authentication.OAuth2DeviceVerificationAuthenticationProvider;
4343
import org.springframework.security.oauth2.server.authorization.authentication.OAuth2DeviceVerificationAuthenticationToken;
44-
import org.springframework.security.oauth2.server.authorization.web.authentication.DelegatingAuthenticationConverter;
4544
import org.springframework.security.oauth2.server.authorization.web.authentication.OAuth2DeviceAuthorizationConsentAuthenticationConverter;
4645
import org.springframework.security.oauth2.server.authorization.web.authentication.OAuth2DeviceVerificationAuthenticationConverter;
4746
import org.springframework.security.web.DefaultRedirectStrategy;
4847
import org.springframework.security.web.RedirectStrategy;
4948
import org.springframework.security.web.authentication.AuthenticationConverter;
5049
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
5150
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
51+
import org.springframework.security.web.authentication.DelegatingAuthenticationConverter;
5252
import org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler;
5353
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
5454
import org.springframework.security.web.util.RedirectUrlBuilder;

oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/web/OAuth2TokenEndpointFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
import org.springframework.security.oauth2.server.authorization.authentication.OAuth2ClientCredentialsAuthenticationProvider;
4242
import org.springframework.security.oauth2.server.authorization.authentication.OAuth2DeviceCodeAuthenticationProvider;
4343
import org.springframework.security.oauth2.server.authorization.authentication.OAuth2RefreshTokenAuthenticationProvider;
44-
import org.springframework.security.oauth2.server.authorization.web.authentication.DelegatingAuthenticationConverter;
4544
import org.springframework.security.oauth2.server.authorization.web.authentication.OAuth2AccessTokenResponseAuthenticationSuccessHandler;
4645
import org.springframework.security.oauth2.server.authorization.web.authentication.OAuth2AuthorizationCodeAuthenticationConverter;
4746
import org.springframework.security.oauth2.server.authorization.web.authentication.OAuth2ClientCredentialsAuthenticationConverter;
@@ -52,6 +51,7 @@
5251
import org.springframework.security.web.authentication.AuthenticationConverter;
5352
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
5453
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
54+
import org.springframework.security.web.authentication.DelegatingAuthenticationConverter;
5555
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
5656
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
5757
import org.springframework.security.web.util.matcher.RequestMatcher;

oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/web/authentication/DelegatingAuthenticationConverter.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2022 the original author or authors.
2+
* Copyright 2020-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -37,7 +37,10 @@
3737
* @author Joe Grandja
3838
* @since 0.0.2
3939
* @see AuthenticationConverter
40+
* @deprecated For removal in 2.0. Use
41+
* {@link org.springframework.security.web.authentication.DelegatingAuthenticationConverter}
4042
*/
43+
@Deprecated(since = "1.4", forRemoval = true)
4144
public final class DelegatingAuthenticationConverter implements AuthenticationConverter {
4245

4346
private final List<AuthenticationConverter> converters;

0 commit comments

Comments
 (0)