diff --git a/src/OpenIddict.Abstractions/Primitives/OpenIddictMessage.cs b/src/OpenIddict.Abstractions/Primitives/OpenIddictMessage.cs index d48dbe52d..8194c2dd6 100644 --- a/src/OpenIddict.Abstractions/Primitives/OpenIddictMessage.cs +++ b/src/OpenIddict.Abstractions/Primitives/OpenIddictMessage.cs @@ -177,37 +177,6 @@ public OpenIddictMessage(IEnumerable - /// Initializes a new OpenIddict message. - /// - /// The message parameters. - /// Parameters with a null or empty key are always ignored. - [Obsolete("This constructor is obsolete and will be removed in a future version.")] - public OpenIddictMessage(IEnumerable?>> parameters) - { - ArgumentNullException.ThrowIfNull(parameters); - - foreach (var parameter in parameters) - { - // Ignore parameters whose name is null or empty. - if (string.IsNullOrEmpty(parameter.Key)) - { - continue; - } - - // Note: the core OAuth 2.0 specification requires that request parameters - // not be present more than once but derived specifications like the - // token exchange specification deliberately allow specifying multiple - // parameters with the same name to represent a multi-valued parameter. - AddParameter(parameter.Key, parameter.Value switch - { - null or { IsDefaultOrEmpty: true } => default, - [string value] => new OpenIddictParameter(value), - [..] values => new OpenIddictParameter(values) - }); - } - } - /// /// Initializes a new OpenIddict message. /// diff --git a/src/OpenIddict.Abstractions/Primitives/OpenIddictRequest.cs b/src/OpenIddict.Abstractions/Primitives/OpenIddictRequest.cs index dff8e09bc..4a8e4169c 100644 --- a/src/OpenIddict.Abstractions/Primitives/OpenIddictRequest.cs +++ b/src/OpenIddict.Abstractions/Primitives/OpenIddictRequest.cs @@ -85,17 +85,6 @@ public OpenIddictRequest(IEnumerable - /// Initializes a new OpenIddict request. - /// - /// The request parameters. - /// Parameters with a null or empty key are always ignored. - [Obsolete("This constructor is obsolete and will be removed in a future version.")] - public OpenIddictRequest(IEnumerable?>> parameters) - : base(parameters) - { - } - /// /// Initializes a new OpenIddict request. /// diff --git a/src/OpenIddict.Abstractions/Primitives/OpenIddictResponse.cs b/src/OpenIddict.Abstractions/Primitives/OpenIddictResponse.cs index de24ad79d..c943c8186 100644 --- a/src/OpenIddict.Abstractions/Primitives/OpenIddictResponse.cs +++ b/src/OpenIddict.Abstractions/Primitives/OpenIddictResponse.cs @@ -84,17 +84,6 @@ public OpenIddictResponse(IEnumerable - /// Initializes a new OpenIddict response. - /// - /// The response parameters. - /// Parameters with a null or empty key are always ignored. - [Obsolete("This constructor is obsolete and will be removed in a future version.")] - public OpenIddictResponse(IEnumerable?>> parameters) - : base(parameters) - { - } - /// /// Initializes a new OpenIddict response. /// diff --git a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.cs b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.cs index c0345448c..9b6197939 100644 --- a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.cs +++ b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.cs @@ -1112,81 +1112,6 @@ OpenIddictClientEndpointType.PostLogoutRedirection when _marshal.IsTracked(conte } } - /// - /// Contains the logic responsible for restoring the state token - /// from the marshalled authentication context, if applicable. - /// - [Obsolete("This class is obsolete and will be removed in a future version.")] - public sealed class RestoreStateTokenFromMarshalledAuthentication : IOpenIddictClientHandler - { - public RestoreStateTokenFromMarshalledAuthentication(OpenIddictClientSystemIntegrationMarshal marshal) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .AddFilter() - .UseSingletonHandler() - .SetOrder(ResolveValidatedStateToken.Descriptor.Order + 500) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(ProcessAuthenticationContext context) => ValueTask.CompletedTask; - } - - /// - /// Contains the logic responsible for restoring the state token - /// principal from the marshalled authentication context, if applicable. - /// - [Obsolete("This class is obsolete and will be removed in a future version.")] - public sealed class RestoreStateTokenPrincipalFromMarshalledAuthentication : IOpenIddictClientHandler - { - public RestoreStateTokenPrincipalFromMarshalledAuthentication(OpenIddictClientSystemIntegrationMarshal marshal) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .AddFilter() - .UseSingletonHandler() - .SetOrder(ValidateStateToken.Descriptor.Order + 500) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(ProcessAuthenticationContext context) => ValueTask.CompletedTask; - } - - /// - /// Contains the logic responsible for restoring the host authentication - /// properties from the marshalled authentication context, if applicable. - /// - [Obsolete("This class is obsolete and will be removed in a future version.")] - public sealed class RestoreHostAuthenticationPropertiesFromMarshalledAuthentication : IOpenIddictClientHandler - { - public RestoreHostAuthenticationPropertiesFromMarshalledAuthentication(OpenIddictClientSystemIntegrationMarshal marshal) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .AddFilter() - .UseSingletonHandler() - .SetOrder(ResolveHostAuthenticationPropertiesFromStateToken.Descriptor.Order + 500) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(ProcessAuthenticationContext context) => ValueTask.CompletedTask; - } - /// /// Contains the logic responsible for redirecting the protocol activation to /// the instance that initially started the authentication demand, if applicable. @@ -1327,280 +1252,6 @@ public ValueTask HandleAsync(ProcessAuthenticationContext context) } } - /// - /// Contains the logic responsible for restoring the frontchannel tokens - /// from the marshalled authentication context, if applicable. - /// - [Obsolete("This class is obsolete and will be removed in a future version.")] - public sealed class RestoreFrontchannelTokensFromMarshalledAuthentication : IOpenIddictClientHandler - { - public RestoreFrontchannelTokensFromMarshalledAuthentication(OpenIddictClientSystemIntegrationMarshal marshal) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .AddFilter() - .UseSingletonHandler() - .SetOrder(ResolveValidatedFrontchannelTokens.Descriptor.Order + 500) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(ProcessAuthenticationContext context) => ValueTask.CompletedTask; - } - - /// - /// Contains the logic responsible for restoring the frontchannel identity - /// token principal from the marshalled authentication context, if applicable. - /// - [Obsolete("This class is obsolete and will be removed in a future version.")] - public sealed class RestoreFrontchannelIdentityTokenPrincipalFromMarshalledAuthentication : IOpenIddictClientHandler - { - public RestoreFrontchannelIdentityTokenPrincipalFromMarshalledAuthentication(OpenIddictClientSystemIntegrationMarshal marshal) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .AddFilter() - .UseSingletonHandler() - .SetOrder(ValidateFrontchannelIdentityToken.Descriptor.Order + 500) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(ProcessAuthenticationContext context) => ValueTask.CompletedTask; - } - - /// - /// Contains the logic responsible for restoring the frontchannel access - /// token principal from the marshalled authentication context, if applicable. - /// - [Obsolete("This class is obsolete and will be removed in a future version.")] - public sealed class RestoreFrontchannelAccessTokenPrincipalFromMarshalledAuthentication : IOpenIddictClientHandler - { - public RestoreFrontchannelAccessTokenPrincipalFromMarshalledAuthentication(OpenIddictClientSystemIntegrationMarshal marshal) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .AddFilter() - .UseSingletonHandler() - .SetOrder(ValidateFrontchannelAccessToken.Descriptor.Order + 500) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(ProcessAuthenticationContext context) => ValueTask.CompletedTask; - } - - /// - /// Contains the logic responsible for restoring the authorization code - /// principal from the marshalled authentication context, if applicable. - /// - [Obsolete("This class is obsolete and will be removed in a future version.")] - public sealed class RestoreAuthorizationCodePrincipalFromMarshalledAuthentication : IOpenIddictClientHandler - { - public RestoreAuthorizationCodePrincipalFromMarshalledAuthentication(OpenIddictClientSystemIntegrationMarshal marshal) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .AddFilter() - .UseSingletonHandler() - .SetOrder(ValidateAuthorizationCode.Descriptor.Order + 500) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(ProcessAuthenticationContext context) => ValueTask.CompletedTask; - } - - /// - /// Contains the logic responsible for restoring the token response - /// from the marshalled authentication context, if applicable. - /// - [Obsolete("This class is obsolete and will be removed in a future version.")] - public sealed class RestoreTokenResponseFromMarshalledAuthentication : IOpenIddictClientHandler - { - public RestoreTokenResponseFromMarshalledAuthentication(OpenIddictClientSystemIntegrationMarshal marshal) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .AddFilter() - .UseSingletonHandler() - .SetOrder(SendTokenRequest.Descriptor.Order + 500) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(ProcessAuthenticationContext context) => ValueTask.CompletedTask; - } - - /// - /// Contains the logic responsible for restoring the backchannel tokens - /// from the marshalled authentication context, if applicable. - /// - [Obsolete("This class is obsolete and will be removed in a future version.")] - public sealed class RestoreBackchannelTokensFromMarshalledAuthentication : IOpenIddictClientHandler - { - public RestoreBackchannelTokensFromMarshalledAuthentication(OpenIddictClientSystemIntegrationMarshal marshal) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .AddFilter() - .UseSingletonHandler() - .SetOrder(ResolveValidatedBackchannelTokens.Descriptor.Order + 500) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(ProcessAuthenticationContext context) => ValueTask.CompletedTask; - } - - /// - /// Contains the logic responsible for restoring the backchannel identity - /// token principal from the marshalled authentication context, if applicable. - /// - [Obsolete("This class is obsolete and will be removed in a future version.")] - public sealed class RestoreBackchannelIdentityTokenPrincipalFromMarshalledAuthentication : IOpenIddictClientHandler - { - public RestoreBackchannelIdentityTokenPrincipalFromMarshalledAuthentication(OpenIddictClientSystemIntegrationMarshal marshal) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .AddFilter() - .UseSingletonHandler() - .SetOrder(ValidateBackchannelIdentityToken.Descriptor.Order + 500) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(ProcessAuthenticationContext context) => ValueTask.CompletedTask; - } - - /// - /// Contains the logic responsible for restoring the frontchannel access - /// token principal from the marshalled authentication context, if applicable. - /// - [Obsolete("This class is obsolete and will be removed in a future version.")] - public sealed class RestoreBackchannelAccessTokenPrincipalFromMarshalledAuthentication : IOpenIddictClientHandler - { - public RestoreBackchannelAccessTokenPrincipalFromMarshalledAuthentication(OpenIddictClientSystemIntegrationMarshal marshal) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .AddFilter() - .UseSingletonHandler() - .SetOrder(ValidateBackchannelAccessToken.Descriptor.Order + 500) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(ProcessAuthenticationContext context) => ValueTask.CompletedTask; - } - - /// - /// Contains the logic responsible for restoring the refresh token - /// principal from the marshalled authentication context, if applicable. - /// - [Obsolete("This class is obsolete and will be removed in a future version.")] - public sealed class RestoreRefreshTokenPrincipalFromMarshalledAuthentication : IOpenIddictClientHandler - { - public RestoreRefreshTokenPrincipalFromMarshalledAuthentication(OpenIddictClientSystemIntegrationMarshal marshal) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .AddFilter() - .UseSingletonHandler() - .SetOrder(ValidateRefreshToken.Descriptor.Order + 500) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(ProcessAuthenticationContext context) => ValueTask.CompletedTask; - } - - /// - /// Contains the logic responsible for restoring the userinfo details - /// from the marshalled authentication context, if applicable. - /// - [Obsolete("This class is obsolete and will be removed in a future version.")] - public sealed class RestoreUserInfoDetailsFromMarshalledAuthentication : IOpenIddictClientHandler - { - public RestoreUserInfoDetailsFromMarshalledAuthentication(OpenIddictClientSystemIntegrationMarshal marshal) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .AddFilter() - .UseSingletonHandler() - .SetOrder(ValidateUserInfoTokenSubject.Descriptor.Order + 500) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(ProcessAuthenticationContext context) => ValueTask.CompletedTask; - } - - /// - /// Contains the logic responsible for restoring the merged principal from the marshalled authentication context, if applicable. - /// - [Obsolete("This class is obsolete and will be removed in a future version.")] - public sealed class RestoreMergedPrincipalFromMarshalledAuthentication : IOpenIddictClientHandler - { - public RestoreMergedPrincipalFromMarshalledAuthentication(OpenIddictClientSystemIntegrationMarshal marshal) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .AddFilter() - .UseSingletonHandler() - .SetOrder(PopulateMergedPrincipal.Descriptor.Order + 500) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(ProcessAuthenticationContext context) => ValueTask.CompletedTask; - } - /// /// Contains the logic responsible for informing the authentication service the operation is complete. /// diff --git a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpBuilder.cs b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpBuilder.cs index 1d67994d1..c4f26151e 100644 --- a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpBuilder.cs +++ b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpBuilder.cs @@ -9,7 +9,6 @@ using System.Net.Http.Headers; using System.Net.Mail; using System.Reflection; -using System.Security.Cryptography.X509Certificates; using OpenIddict.Client; using OpenIddict.Client.SystemNetHttp; using Polly; @@ -287,50 +286,6 @@ public OpenIddictClientSystemNetHttpBuilder SetProductInformation(Assembly assem productVersion: assembly.GetName().Version!.ToString())); } - /// - /// Sets the delegate called by OpenIddict when trying to resolve the self-signed - /// TLS client authentication certificate that will be used for OAuth 2.0 - /// mTLS-based client authentication (self_signed_tls_client_auth), if applicable. - /// - /// The selector delegate. - /// - /// If no value is explicitly set, OpenIddict automatically tries to resolve the - /// X.509 certificate from the signing credentials attached to the client registration - /// (in this case, the X.509 certificate MUST include the digital signature and - /// client authentication key usages to be automatically selected by OpenIddict). - /// - /// The instance. - [Obsolete("This option is no longer supported and will be removed in a future version.")] - public OpenIddictClientSystemNetHttpBuilder SetSelfSignedTlsClientAuthenticationCertificateSelector( - Func selector) - { - ArgumentNullException.ThrowIfNull(selector); - - return Configure(options => options.SelfSignedTlsClientAuthenticationCertificateSelector = selector); - } - - /// - /// Sets the delegate called by OpenIddict when trying to resolve the - /// TLS client authentication certificate that will be used for OAuth 2.0 - /// mTLS-based client authentication (tls_client_auth), if applicable. - /// - /// The selector delegate. - /// - /// If no value is explicitly set, OpenIddict automatically tries to resolve the - /// X.509 certificate from the signing credentials attached to the client registration - /// (in this case, the X.509 certificate MUST include the digital signature and - /// client authentication key usages to be automatically selected by OpenIddict). - /// - /// The instance. - [Obsolete("This option is no longer supported and will be removed in a future version.")] - public OpenIddictClientSystemNetHttpBuilder SetTlsClientAuthenticationCertificateSelector( - Func selector) - { - ArgumentNullException.ThrowIfNull(selector); - - return Configure(options => options.TlsClientAuthenticationCertificateSelector = selector); - } - /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object? obj) => base.Equals(obj); diff --git a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpConfiguration.cs b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpConfiguration.cs index 7ff3d36a8..616f95bb8 100644 --- a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpConfiguration.cs +++ b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpConfiguration.cs @@ -25,8 +25,7 @@ namespace OpenIddict.Client.SystemNetHttp; [EditorBrowsable(EditorBrowsableState.Advanced)] public sealed class OpenIddictClientSystemNetHttpConfiguration : IConfigureOptions, IConfigureNamedOptions, - IPostConfigureOptions, - IPostConfigureOptions + IPostConfigureOptions { private readonly IServiceProvider _provider; @@ -217,9 +216,4 @@ public void PostConfigure(string? name, HttpClientFactoryOptions options) handler.UseCookies = false; }); } - - /// - [Obsolete("This method is no longer supported and will be removed in a future version.")] - public void PostConfigure(string? name, OpenIddictClientSystemNetHttpOptions options) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); } diff --git a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.cs b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.cs index ba3fea56f..616f89dfd 100644 --- a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.cs +++ b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.cs @@ -32,138 +32,6 @@ public static partial class OpenIddictClientSystemNetHttpHandlers .. UserInfo.DefaultHandlers ]; - /// - /// Contains the logic responsible for negotiating the best token endpoint client - /// authentication method supported by both the client and the authorization server. - /// - [Obsolete("This class is obsolete and will be removed in a future version.")] - public sealed class AttachNonDefaultTokenEndpointClientAuthenticationMethod : IOpenIddictClientHandler - { - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .AddFilter() - .UseSingletonHandler() - .SetOrder(AttachTokenEndpointClientAuthenticationMethod.Descriptor.Order - 500) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(ProcessAuthenticationContext context) => ValueTask.CompletedTask; - } - - /// - /// Contains the logic responsible for negotiating the best token binding - /// methods supported by both the client and the authorization server. - /// - [Obsolete("This class is obsolete and will be removed in a future version.")] - public sealed class AttachNonDefaultUserInfoEndpointTokenBindingMethods : IOpenIddictClientHandler - { - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .AddFilter() - .UseSingletonHandler() - .SetOrder(AttachUserInfoEndpointTokenBindingMethods.Descriptor.Order - 500) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(ProcessAuthenticationContext context) => ValueTask.CompletedTask; - } - - /// - /// Contains the logic responsible for negotiating the best device authorization endpoint - /// client authentication method supported by both the client and the authorization server. - /// - [Obsolete("This class is obsolete and will be removed in a future version.")] - public sealed class AttachNonDefaultDeviceAuthorizationEndpointClientAuthenticationMethod : IOpenIddictClientHandler - { - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .AddFilter() - .UseSingletonHandler() - .SetOrder(AttachDeviceAuthorizationEndpointClientAuthenticationMethod.Descriptor.Order - 500) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(ProcessChallengeContext context) => ValueTask.CompletedTask; - } - - /// - /// Contains the logic responsible for negotiating the best pushed authorization endpoint - /// client authentication method supported by both the client and the authorization server. - /// - [Obsolete("This class is obsolete and will be removed in a future version.")] - public sealed class AttachNonDefaultPushedAuthorizationEndpointClientAuthenticationMethod : IOpenIddictClientHandler - { - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .AddFilter() - .UseSingletonHandler() - .SetOrder(AttachPushedAuthorizationEndpointClientAuthenticationMethod.Descriptor.Order - 500) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(ProcessChallengeContext context) => ValueTask.CompletedTask; - } - - /// - /// Contains the logic responsible for negotiating the best introspection endpoint client - /// authentication method supported by both the client and the authorization server. - /// - [Obsolete("This class is obsolete and will be removed in a future version.")] - public sealed class AttachNonDefaultIntrospectionEndpointClientAuthenticationMethod : IOpenIddictClientHandler - { - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .AddFilter() - .UseSingletonHandler() - .SetOrder(AttachIntrospectionEndpointClientAuthenticationMethod.Descriptor.Order - 500) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(ProcessIntrospectionContext context) => ValueTask.CompletedTask; - } - - /// - /// Contains the logic responsible for negotiating the best revocation endpoint client - /// authentication method supported by both the client and the authorization server. - /// - [Obsolete("This class is obsolete and will be removed in a future version.")] - public sealed class AttachNonDefaultRevocationEndpointClientAuthenticationMethod : IOpenIddictClientHandler - { - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .AddFilter() - .UseSingletonHandler() - .SetOrder(AttachRevocationEndpointClientAuthenticationMethod.Descriptor.Order - 500) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(ProcessRevocationContext context) => ValueTask.CompletedTask; - } - /// /// Contains the logic responsible for creating and attaching a . /// diff --git a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpOptions.cs b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpOptions.cs index b5d2ac972..de8935be6 100644 --- a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpOptions.cs +++ b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpOptions.cs @@ -4,12 +4,10 @@ * the license and the contributors participating to this project. */ -using System.ComponentModel; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Net.Mail; -using System.Security.Cryptography.X509Certificates; using Polly; using Polly.Extensions.Http; @@ -82,34 +80,4 @@ public sealed class OpenIddictClientSystemNetHttpOptions /// instances created by the OpenIddict client/System.Net.Http integration. /// public List> HttpClientHandlerActions { get; } = []; - - /// - /// Gets or sets the delegate called by OpenIddict when trying to resolve the - /// self-signed TLS client authentication certificate that will be used for OAuth 2.0 - /// mTLS-based client authentication (self_signed_tls_client_auth), if applicable. - /// - /// - /// If no value is explicitly set, OpenIddict automatically tries to resolve the - /// X.509 certificate from the signing credentials attached to the client registration - /// (in this case, the X.509 certificate MUST include the digital signature and - /// client authentication key usages to be automatically selected by OpenIddict). - /// - [EditorBrowsable(EditorBrowsableState.Advanced)] - [Obsolete("This option is no longer supported and will be removed in a future version.")] - public Func SelfSignedTlsClientAuthenticationCertificateSelector { get; set; } = default!; - - /// - /// Gets or sets the delegate called by OpenIddict when trying to resolve the TLS - /// client authentication certificate that will be used for OAuth 2.0 mTLS-based - /// client authentication (tls_client_auth), if applicable. - /// - /// - /// If no value is explicitly set, OpenIddict automatically tries to resolve the - /// X.509 certificate from the signing credentials attached to the client registration - /// (in this case, the X.509 certificate MUST include the digital signature and - /// client authentication key usages to be automatically selected by OpenIddict). - /// - [EditorBrowsable(EditorBrowsableState.Advanced)] - [Obsolete("This option is no longer supported and will be removed in a future version.")] - public Func TlsClientAuthenticationCertificateSelector { get; set; } = default!; } diff --git a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationConfiguration.cs b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationConfiguration.cs index 377c70ed1..3fcd53f5b 100644 --- a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationConfiguration.cs +++ b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationConfiguration.cs @@ -6,7 +6,6 @@ using System.ComponentModel; using Microsoft.Extensions.Options; -using OpenIddict.Client.SystemNetHttp; namespace OpenIddict.Client.WebIntegration; @@ -15,8 +14,7 @@ namespace OpenIddict.Client.WebIntegration; /// [EditorBrowsable(EditorBrowsableState.Advanced)] public sealed partial class OpenIddictClientWebIntegrationConfiguration : IConfigureOptions, - IPostConfigureOptions, - IPostConfigureOptions + IPostConfigureOptions { /// public void Configure(OpenIddictClientOptions options) @@ -43,11 +41,6 @@ public void PostConfigure(string? name, OpenIddictClientOptions options) } } - /// - [Obsolete("This method is no longer supported and will be removed in a future version.")] - public void PostConfigure(string? name, OpenIddictClientSystemNetHttpOptions options) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - /// /// Amends the registration with the provider-specific configuration logic. /// diff --git a/src/OpenIddict.Client/OpenIddictClientEvents.cs b/src/OpenIddict.Client/OpenIddictClientEvents.cs index 1610d433b..c7cd6d473 100644 --- a/src/OpenIddict.Client/OpenIddictClientEvents.cs +++ b/src/OpenIddict.Client/OpenIddictClientEvents.cs @@ -171,12 +171,6 @@ protected BaseExternalContext(OpenIddictClientTransaction transaction) /// this peer when communicating with the external endpoint, if applicable. /// public X509Certificate2? LocalCertificate { get; set; } - - /// - /// Gets or sets the token binding method used when communicating with the external endpoint, if applicable. - /// - [Obsolete("This property is no longer used and will be removed in a future version.")] - public HashSet TokenBindingMethods { get; } = new(StringComparer.Ordinal); } /// @@ -434,13 +428,6 @@ public OpenIddictRequest Request /// public X509Certificate2? UserInfoEndpointClientCertificate { get; set; } - /// - /// Gets or sets the token binding methods used when - /// communicating with the userinfo endpoint, if applicable. - /// - [Obsolete("This property is no longer used and will be removed in a future version.")] - public HashSet UserInfoEndpointTokenBindingMethods { get; } = new(StringComparer.Ordinal); - /// /// Gets or sets a boolean indicating whether the token entry associated /// with the state token should be marked as redeemed in the database. diff --git a/src/OpenIddict.Client/OpenIddictClientHandlers.cs b/src/OpenIddict.Client/OpenIddictClientHandlers.cs index 64c21b0bd..ef123a2bd 100644 --- a/src/OpenIddict.Client/OpenIddictClientHandlers.cs +++ b/src/OpenIddict.Client/OpenIddictClientHandlers.cs @@ -4151,28 +4151,6 @@ X509Certificate2 certificate when OpenIddictHelpers.IsSelfIssuedCertificate(cert } } - /// - /// Contains the logic responsible for negotiating the best userinfo endpoint client - /// authentication method supported by both the client and the authorization server. - /// - [Obsolete("This class is obsolete and will be removed in a future version.")] - public sealed class AttachUserInfoEndpointTokenBindingMethods : IOpenIddictClientHandler - { - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .AddFilter() - .UseSingletonHandler() - .SetOrder(EvaluateUserInfoRequest.Descriptor.Order + 1_000) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(ProcessAuthenticationContext context) => ValueTask.CompletedTask; - } - /// /// Contains the logic responsible for resolving the URI of the userinfo endpoint. /// diff --git a/src/OpenIddict.Quartz/OpenIddictQuartzConfiguration.cs b/src/OpenIddict.Quartz/OpenIddictQuartzConfiguration.cs index 949668144..e71b7fc73 100644 --- a/src/OpenIddict.Quartz/OpenIddictQuartzConfiguration.cs +++ b/src/OpenIddict.Quartz/OpenIddictQuartzConfiguration.cs @@ -53,6 +53,8 @@ public void Configure(QuartzOptions options) /// public void PostConfigure(string? name, OpenIddictQuartzOptions options) { + ArgumentNullException.ThrowIfNull(options); + options.TimeProvider ??= _provider.GetService() ?? TimeProvider.System; } } diff --git a/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpBuilder.cs b/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpBuilder.cs index 4d042a360..548342daf 100644 --- a/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpBuilder.cs +++ b/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpBuilder.cs @@ -9,7 +9,6 @@ using System.Net.Http.Headers; using System.Net.Mail; using System.Reflection; -using System.Security.Cryptography.X509Certificates; using OpenIddict.Validation.SystemNetHttp; using Polly; @@ -195,50 +194,6 @@ public OpenIddictValidationSystemNetHttpBuilder SetProductInformation(Assembly a productVersion: assembly.GetName().Version!.ToString())); } - /// - /// Sets the delegate called by OpenIddict when trying to resolve the self-signed - /// TLS client authentication certificate that will be used for OAuth 2.0 - /// mTLS-based client authentication (self_signed_tls_client_auth), if applicable. - /// - /// The selector delegate. - /// - /// If no value is explicitly set, OpenIddict automatically tries to resolve the - /// X.509 certificate from the signing credentials attached to the validation options - /// (in this case, the X.509 certificate MUST include the digital signature and - /// client authentication key usages to be automatically selected by OpenIddict). - /// - /// The instance. - [Obsolete("This option is no longer supported and will be removed in a future version.")] - public OpenIddictValidationSystemNetHttpBuilder SetSelfSignedTlsClientAuthenticationCertificateSelector( - Func selector) - { - ArgumentNullException.ThrowIfNull(selector); - - return Configure(options => options.SelfSignedTlsClientAuthenticationCertificateSelector = selector); - } - - /// - /// Sets the delegate called by OpenIddict when trying to resolve the - /// TLS client authentication certificate that will be used for OAuth 2.0 - /// mTLS-based client authentication (tls_client_auth), if applicable. - /// - /// The selector delegate. - /// - /// If no value is explicitly set, OpenIddict automatically tries to resolve the - /// X.509 certificate from the signing credentials attached to the validation options - /// (in this case, the X.509 certificate MUST include the digital signature and - /// client authentication key usages to be automatically selected by OpenIddict). - /// - /// The instance. - [Obsolete("This option is no longer supported and will be removed in a future version.")] - public OpenIddictValidationSystemNetHttpBuilder SetTlsClientAuthenticationCertificateSelector( - Func selector) - { - ArgumentNullException.ThrowIfNull(selector); - - return Configure(options => options.TlsClientAuthenticationCertificateSelector = selector); - } - /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object? obj) => base.Equals(obj); diff --git a/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpConfiguration.cs b/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpConfiguration.cs index aa88cc1f6..c963b9e92 100644 --- a/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpConfiguration.cs +++ b/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpConfiguration.cs @@ -25,8 +25,7 @@ namespace OpenIddict.Validation.SystemNetHttp; [EditorBrowsable(EditorBrowsableState.Advanced)] public sealed class OpenIddictValidationSystemNetHttpConfiguration : IConfigureOptions, IConfigureNamedOptions, - IPostConfigureOptions, - IPostConfigureOptions + IPostConfigureOptions { private readonly IServiceProvider _provider; @@ -213,9 +212,4 @@ public void PostConfigure(string? name, HttpClientFactoryOptions options) handler.UseCookies = false; }); } - - /// - [Obsolete("This method is no longer supported and will be removed in a future version.")] - public void PostConfigure(string? name, OpenIddictValidationSystemNetHttpOptions options) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); } diff --git a/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpHandlers.cs b/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpHandlers.cs index 9588b9edf..d12e1bd1d 100644 --- a/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpHandlers.cs +++ b/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpHandlers.cs @@ -27,27 +27,6 @@ public static partial class OpenIddictValidationSystemNetHttpHandlers .. Introspection.DefaultHandlers ]; - /// - /// Contains the logic responsible for negotiating the best introspection endpoint client - /// authentication method supported by both the client and the authorization server. - /// - [Obsolete("This class is obsolete and will be removed in a future version.")] - public sealed class AttachNonDefaultIntrospectionEndpointClientAuthenticationMethod : IOpenIddictValidationHandler - { - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictValidationHandlerDescriptor Descriptor { get; } - = OpenIddictValidationHandlerDescriptor.CreateBuilder() - .UseSingletonHandler() - .SetOrder(AttachIntrospectionEndpointClientAuthenticationMethod.Descriptor.Order - 500) - .SetType(OpenIddictValidationHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(ProcessAuthenticationContext context) => ValueTask.CompletedTask; - } - /// /// Contains the logic responsible for creating and attaching a . /// diff --git a/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpOptions.cs b/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpOptions.cs index 995968dd2..ff754e9bf 100644 --- a/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpOptions.cs +++ b/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpOptions.cs @@ -4,12 +4,10 @@ * the license and the contributors participating to this project. */ -using System.ComponentModel; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Net.Mail; -using System.Security.Cryptography.X509Certificates; using Polly; using Polly.Extensions.Http; @@ -82,34 +80,4 @@ public sealed class OpenIddictValidationSystemNetHttpOptions /// instances created by the OpenIddict validation/System.Net.Http integration. /// public List> HttpClientHandlerActions { get; } = []; - - /// - /// Gets or sets the delegate called by OpenIddict when trying to resolve the - /// self-signed TLS client authentication certificate that will be used for OAuth 2.0 - /// mTLS-based client authentication (self_signed_tls_client_auth), if applicable. - /// - /// - /// If no value is explicitly set, OpenIddict automatically tries to resolve the - /// X.509 certificate from the signing credentials attached to the validation options - /// (in this case, the X.509 certificate MUST include the digital signature and - /// client authentication key usages to be automatically selected by OpenIddict). - /// - [EditorBrowsable(EditorBrowsableState.Advanced)] - [Obsolete("This option is no longer supported and will be removed in a future version.")] - public Func SelfSignedTlsClientAuthenticationCertificateSelector { get; set; } = default!; - - /// - /// Gets or sets the delegate called by OpenIddict when trying to resolve the TLS - /// client authentication certificate that will be used for OAuth 2.0 mTLS-based - /// client authentication (tls_client_auth), if applicable. - /// - /// - /// If no value is explicitly set, OpenIddict automatically tries to resolve the - /// X.509 certificate from the signing credentials attached to the validation options - /// (in this case, the X.509 certificate MUST include the digital signature and - /// client authentication key usages to be automatically selected by OpenIddict). - /// - [EditorBrowsable(EditorBrowsableState.Advanced)] - [Obsolete("This option is no longer supported and will be removed in a future version.")] - public Func TlsClientAuthenticationCertificateSelector { get; set; } = default!; }