diff --git a/src/OpenIddict.Abstractions/Descriptors/OpenIddictApplicationDescriptor.cs b/src/OpenIddict.Abstractions/Descriptors/OpenIddictApplicationDescriptor.cs index 196296f8c..648efa396 100644 --- a/src/OpenIddict.Abstractions/Descriptors/OpenIddictApplicationDescriptor.cs +++ b/src/OpenIddict.Abstractions/Descriptors/OpenIddictApplicationDescriptor.cs @@ -81,15 +81,4 @@ public class OpenIddictApplicationDescriptor /// Gets the settings associated with the application. /// public Dictionary Settings { get; } = new(StringComparer.Ordinal); - - /// - /// Gets or sets the client type associated with the application. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete($"This property was replaced by {nameof(ClientType)} and will be removed in a future version.", true)] - public string? Type - { - get => ClientType; - set => ClientType = value; - } } diff --git a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationExtensions.cs b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationExtensions.cs index 123e4dcea..0e4981af6 100644 --- a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationExtensions.cs +++ b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationExtensions.cs @@ -112,9 +112,6 @@ public static OpenIddictClientSystemIntegrationBuilder UseSystemIntegration(this builder.Services.TryAddSingleton(); builder.Services.TryAddSingleton(); builder.Services.TryAddSingleton(); -#pragma warning disable CS0618 - builder.Services.TryAddSingleton(); -#pragma warning restore CS0618 // Register the built-in event handlers used by the OpenIddict client system integration components. // Note: the order used here is not important, as the actual order is set in the options. diff --git a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlerFilters.cs b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlerFilters.cs index dab17af12..942dc0e54 100644 --- a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlerFilters.cs +++ b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlerFilters.cs @@ -258,35 +258,6 @@ public ValueTask IsActiveAsync(BaseContext context) return new(mode is WebAuthenticationBroker); } -#endif - return new(false); - } - } - - /// - /// Represents a filter that excludes the associated handlers if no - /// web authentication operation was triggered during the transaction. - /// - [Obsolete("This filter is obsolete and will be removed in a future version.")] - public sealed class RequireWebAuthenticationResult : IOpenIddictClientHandlerFilter - { - /// - public ValueTask IsActiveAsync(BaseContext context) - { - if (context is null) - { - throw new ArgumentNullException(nameof(context)); - } - -#if SUPPORTS_WINDOWS_RUNTIME - if (IsWebAuthenticationBrokerSupported()) - { - return new(ContainsWebAuthenticationResult(context.Transaction)); - } - - [MethodImpl(MethodImplOptions.NoInlining)] - static bool ContainsWebAuthenticationResult(OpenIddictClientTransaction transaction) - => transaction.GetWebAuthenticationResult() is not null; #endif return new(false); } diff --git a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.cs b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.cs index 9e5222ffc..020d98a8d 100644 --- a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.cs +++ b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.cs @@ -237,29 +237,6 @@ public ValueTask HandleAsync(ProcessRequestContext context) } } - /// - /// Contains the logic responsible for resolving the request URI from the web authentication result. - /// Note: this handler is not used when the OpenID Connect request is not a web authentication result. - /// - [Obsolete("This event handler is obsolete and will be removed in a future version.")] - public sealed class ResolveRequestUriFromWebAuthenticationResult : IOpenIddictClientHandler - { - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .AddFilter() - .UseSingletonHandler() - .SetOrder(ResolveRequestUriFromPlatformCallback.Descriptor.Order + 1_000) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(ProcessRequestContext context) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - } - /// /// Contains the logic responsible for inferring the endpoint type from the request URI, ignoring /// the port when comparing the request URI with the endpoint URIs configured in the options. @@ -620,30 +597,6 @@ public ValueTask HandleAsync(TContext context) } } - /// - /// Contains the logic responsible for extracting OpenID Connect - /// requests from the response data of a web authentication result. - /// Note: this handler is not used when the OpenID Connect request is not a web authentication result. - /// - [Obsolete("This event handler is obsolete and will be removed in a future version.")] - public sealed class ExtractWebAuthenticationResultData : IOpenIddictClientHandler where TContext : BaseValidatingContext - { - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .AddFilter() - .UseSingletonHandler>() - .SetOrder(ExtractPlatformCallbackParameters.Descriptor.Order + 1_000) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(TContext context) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - } - /// /// Contains the logic responsible for waiting for the marshalled authentication operation to complete, if applicable. /// @@ -2446,42 +2399,4 @@ public ValueTask HandleAsync(TContext context) return default; } } - - /// - /// Contains the logic responsible for marking OpenID Connect - /// responses returned via web authentication results as processed. - /// - [Obsolete("This handler is obsolete and will be removed in a future version.")] - public sealed class ProcessWebAuthenticationResultResponse : IOpenIddictClientHandler - where TContext : BaseRequestContext - { - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .AddFilter() - .UseSingletonHandler>() - .SetOrder(int.MaxValue) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(TContext context) - { - if (context is null) - { - throw new ArgumentNullException(nameof(context)); - } - - // For both protocol activations (initial or redirected) and web-view-like results, - // no proper response can be generated and eventually displayed to the user. In this - // case, simply stop processing the response and mark the request as fully handled. - // - // Note: this logic applies to both successful and errored responses. - - context.HandleRequest(); - return default; - } - } } diff --git a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHelpers.cs b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHelpers.cs index ccb11fe3a..770baed39 100644 --- a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHelpers.cs +++ b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHelpers.cs @@ -68,19 +68,6 @@ public static class OpenIddictClientSystemIntegrationHelpers public static HttpListenerContext? GetHttpListenerContext(this OpenIddictClientTransaction transaction) => transaction.GetProperty(typeof(HttpListenerContext).FullName!); -#if SUPPORTS_WINDOWS_RUNTIME - /// - /// Gets the associated with the current context. - /// - /// The transaction instance. - /// The instance or if it couldn't be found. - [Obsolete("This extension is obsolete and will be removed in a future version."), SupportedOSPlatform("windows10.0.17763")] - public static WebAuthenticationResult? GetWebAuthenticationResult(this OpenIddictClientTransaction transaction) - => transaction.GetPlatformCallback() is OpenIddictClientSystemIntegrationPlatformCallback callback && - callback.Properties.TryGetValue(typeof(WebAuthenticationResult).FullName!, out object? property) && - property is WebAuthenticationResult result ? result : null; -#endif - /// /// Determines whether the current Windows version /// is greater than or equals to the specified version. diff --git a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpExtensions.cs b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpExtensions.cs index 617b30578..544053eca 100644 --- a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpExtensions.cs +++ b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpExtensions.cs @@ -37,9 +37,6 @@ public static OpenIddictClientSystemNetHttpBuilder UseSystemNetHttp(this OpenIdd builder.Services.TryAdd(OpenIddictClientSystemNetHttpHandlers.DefaultHandlers.Select(descriptor => descriptor.ServiceDescriptor)); // Register the built-in filters used by the default OpenIddict System.Net.Http event handlers. -#pragma warning disable CS0618 - builder.Services.TryAddSingleton(); -#pragma warning restore CS0618 builder.Services.TryAddSingleton(); // Note: TryAddEnumerable() is used here to ensure the initializers are registered only once. diff --git a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlerFilters.cs b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlerFilters.cs index e58000011..5b610d8b5 100644 --- a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlerFilters.cs +++ b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlerFilters.cs @@ -11,26 +11,6 @@ namespace OpenIddict.Client.SystemNetHttp; [EditorBrowsable(EditorBrowsableState.Advanced)] public static class OpenIddictClientSystemNetHttpHandlerFilters { - /// - /// Represents a filter that excludes the associated handlers if the URI is not an HTTP or HTTPS address. - /// - [Obsolete("This filter is obsolete and will be removed in a future version.")] - public sealed class RequireHttpMetadataUri : IOpenIddictClientHandlerFilter - { - /// - public ValueTask IsActiveAsync(BaseExternalContext context) - { - if (context is null) - { - throw new ArgumentNullException(nameof(context)); - } - - return new( - string.Equals(context.RemoteUri?.Scheme, Uri.UriSchemeHttp, StringComparison.OrdinalIgnoreCase) || - string.Equals(context.RemoteUri?.Scheme, Uri.UriSchemeHttps, StringComparison.OrdinalIgnoreCase)); - } - } - /// /// Represents a filter that excludes the associated handlers if the URI is not an HTTP or HTTPS address. /// diff --git a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Discovery.cs b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Discovery.cs index 041ed1011..83ef00a57 100644 --- a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Discovery.cs +++ b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Discovery.cs @@ -259,50 +259,6 @@ public ValueTask HandleAsync(HandleConfigurationResponseContext context) } } - /// - /// Contains the logic responsible for amending the client authentication methods - /// supported by the device authorization endpoint for the providers that require it. - /// - [Obsolete("This event handler is obsolete and will be removed in a future version.", error: true)] - public sealed class AmendDeviceAuthorizationEndpointClientAuthenticationMethods : IOpenIddictClientHandler - { - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .UseSingletonHandler() - .SetOrder(ExtractTokenEndpointClientAuthenticationMethods.Descriptor.Order + 500) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(HandleConfigurationResponseContext context) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - } - - /// - /// Contains the logic responsible for amending the client authentication - /// methods supported by the token endpoint for the providers that require it. - /// - [Obsolete("This event handler is obsolete and will be removed in a future version.", error: true)] - public sealed class AmendTokenEndpointClientAuthenticationMethods : IOpenIddictClientHandler - { - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .UseSingletonHandler() - .SetOrder(AmendDeviceAuthorizationEndpointClientAuthenticationMethods.Descriptor.Order + 500) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(HandleConfigurationResponseContext context) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - } - /// /// Contains the logic responsible for amending the supported client /// authentication methods for the providers that require it. diff --git a/src/OpenIddict.Client/OpenIddictClientConfiguration.cs b/src/OpenIddict.Client/OpenIddictClientConfiguration.cs index 2bf61114a..d09d181eb 100644 --- a/src/OpenIddict.Client/OpenIddictClientConfiguration.cs +++ b/src/OpenIddict.Client/OpenIddictClientConfiguration.cs @@ -27,14 +27,6 @@ public sealed class OpenIddictClientConfiguration : IPostConfigureOptions - /// Creates a new instance of the class. - /// - /// The OpenIddict client service. - [Obsolete("This constructor is no longer supported and will be removed in a future version.", error: true)] - public OpenIddictClientConfiguration(OpenIddictClientService service) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - /// /// Creates a new instance of the class. /// diff --git a/src/OpenIddict.Client/OpenIddictClientHandlerFilters.cs b/src/OpenIddict.Client/OpenIddictClientHandlerFilters.cs index 3e4c2e8a6..e01710e0a 100644 --- a/src/OpenIddict.Client/OpenIddictClientHandlerFilters.cs +++ b/src/OpenIddict.Client/OpenIddictClientHandlerFilters.cs @@ -629,24 +629,10 @@ public ValueTask IsActiveAsync(ProcessAuthenticationContext context) /// /// Represents a filter that excludes the associated handlers if the WS-Federation claim mapping feature was disabled. /// - public sealed class RequireWebServicesFederationClaimMappingEnabled : - IOpenIddictClientHandlerFilter, - IOpenIddictClientHandlerFilter + public sealed class RequireWebServicesFederationClaimMappingEnabled : IOpenIddictClientHandlerFilter { /// - [Obsolete("This method is obsolete and will be removed in a future version.")] - public ValueTask IsActiveAsync(ProcessAuthenticationContext context) - { - if (context is null) - { - throw new ArgumentNullException(nameof(context)); - } - - return new(!context.Options.DisableWebServicesFederationClaimMapping); - } - - /// - ValueTask IOpenIddictClientHandlerFilter.IsActiveAsync(BaseContext context) + public ValueTask IsActiveAsync(BaseContext context) { if (context is null) { diff --git a/src/OpenIddict.Quartz/OpenIddictQuartzConfiguration.cs b/src/OpenIddict.Quartz/OpenIddictQuartzConfiguration.cs index ccd9c113e..241883e83 100644 --- a/src/OpenIddict.Quartz/OpenIddictQuartzConfiguration.cs +++ b/src/OpenIddict.Quartz/OpenIddictQuartzConfiguration.cs @@ -18,12 +18,6 @@ public sealed class OpenIddictQuartzConfiguration : IConfigureOptions - /// Creates a new instance of the class. - /// - [Obsolete("This constructor is no longer supported and will be removed in a future version.", error: true)] - public OpenIddictQuartzConfiguration() => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - /// /// Creates a new instance of the class. /// diff --git a/src/OpenIddict.Server/OpenIddictServerConfiguration.cs b/src/OpenIddict.Server/OpenIddictServerConfiguration.cs index 41b3c3443..b8caa78de 100644 --- a/src/OpenIddict.Server/OpenIddictServerConfiguration.cs +++ b/src/OpenIddict.Server/OpenIddictServerConfiguration.cs @@ -24,12 +24,6 @@ public sealed class OpenIddictServerConfiguration : IPostConfigureOptions - /// Creates a new instance of the class. - /// - [Obsolete("This constructor is no longer supported and will be removed in a future version.", error: true)] - public OpenIddictServerConfiguration() => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - /// /// Creates a new instance of the class. /// diff --git a/src/OpenIddict.Server/OpenIddictServerHandlers.Authentication.cs b/src/OpenIddict.Server/OpenIddictServerHandlers.Authentication.cs index 0be08e40e..76d9de706 100644 --- a/src/OpenIddict.Server/OpenIddictServerHandlers.Authentication.cs +++ b/src/OpenIddict.Server/OpenIddictServerHandlers.Authentication.cs @@ -1068,9 +1068,6 @@ public sealed class ValidateResponseType : IOpenIddictServerHandler throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - public ValidateResponseType(IOpenIddictApplicationManager? applicationManager = null) => _applicationManager = applicationManager; diff --git a/src/OpenIddict.Server/OpenIddictServerHandlers.Protection.cs b/src/OpenIddict.Server/OpenIddictServerHandlers.Protection.cs index 3f91fbd18..4431087ef 100644 --- a/src/OpenIddict.Server/OpenIddictServerHandlers.Protection.cs +++ b/src/OpenIddict.Server/OpenIddictServerHandlers.Protection.cs @@ -1557,31 +1557,5 @@ public async ValueTask HandleAsync(GenerateTokenContext context) } } } - - /// - /// Contains the logic responsible for beautifying user-typed tokens. - /// Note: this handler is not used when the degraded mode is enabled. - /// - [Obsolete("This event handler is obsolete and will be removed in a future version.", error: true)] - public sealed class BeautifyToken : IOpenIddictServerHandler - { - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictServerHandlerDescriptor Descriptor { get; } - = OpenIddictServerHandlerDescriptor.CreateBuilder() - // Technically, this handler doesn't require that the degraded mode be disabled - // but the default CreateReferenceEntry handler that creates the user code - // reference identifiers only works when the degraded mode is disabled. - .AddFilter() - .UseSingletonHandler() - .SetOrder(AttachTokenPayload.Descriptor.Order + 1_000) - .SetType(OpenIddictServerHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(GenerateTokenContext context) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - } } } diff --git a/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpExtensions.cs b/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpExtensions.cs index 9a943d7f1..2409c70c2 100644 --- a/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpExtensions.cs +++ b/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpExtensions.cs @@ -37,9 +37,6 @@ public static OpenIddictValidationSystemNetHttpBuilder UseSystemNetHttp(this Ope builder.Services.TryAdd(OpenIddictValidationSystemNetHttpHandlers.DefaultHandlers.Select(descriptor => descriptor.ServiceDescriptor)); // Register the built-in filters used by the default OpenIddict System.Net.Http event handlers. -#pragma warning disable CS0618 - builder.Services.TryAddSingleton(); -#pragma warning restore CS0618 builder.Services.TryAddSingleton(); // Note: TryAddEnumerable() is used here to ensure the initializers are registered only once. diff --git a/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpHandlerFilters.cs b/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpHandlerFilters.cs index f7760ef33..c47afa3e2 100644 --- a/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpHandlerFilters.cs +++ b/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpHandlerFilters.cs @@ -11,26 +11,6 @@ namespace OpenIddict.Validation.SystemNetHttp; [EditorBrowsable(EditorBrowsableState.Advanced)] public static class OpenIddictValidationSystemNetHttpHandlerFilters { - /// - /// Represents a filter that excludes the associated handlers if the URI is not an HTTP or HTTPS address. - /// - [Obsolete("This filter is obsolete and will be removed in a future version.")] - public sealed class RequireHttpMetadataUri : IOpenIddictValidationHandlerFilter - { - /// - public ValueTask IsActiveAsync(BaseExternalContext context) - { - if (context is null) - { - throw new ArgumentNullException(nameof(context)); - } - - return new( - string.Equals(context.RemoteUri?.Scheme, Uri.UriSchemeHttp, StringComparison.OrdinalIgnoreCase) || - string.Equals(context.RemoteUri?.Scheme, Uri.UriSchemeHttps, StringComparison.OrdinalIgnoreCase)); - } - } - /// /// Represents a filter that excludes the associated handlers if the URI is not an HTTP or HTTPS address. /// diff --git a/src/OpenIddict.Validation/OpenIddictValidationConfiguration.cs b/src/OpenIddict.Validation/OpenIddictValidationConfiguration.cs index c5688f34d..50697788f 100644 --- a/src/OpenIddict.Validation/OpenIddictValidationConfiguration.cs +++ b/src/OpenIddict.Validation/OpenIddictValidationConfiguration.cs @@ -20,14 +20,6 @@ public sealed class OpenIddictValidationConfiguration : IPostConfigureOptions - /// Creates a new instance of the class. - /// - /// The validation service. - [Obsolete("This constructor is no longer supported and will be removed in a future version.", error: true)] - public OpenIddictValidationConfiguration(OpenIddictValidationService service) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - /// /// Creates a new instance of the class. ///