Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,4 @@ public class OpenIddictApplicationDescriptor
/// Gets the settings associated with the application.
/// </summary>
public Dictionary<string, string> Settings { get; } = new(StringComparer.Ordinal);

/// <summary>
/// Gets or sets the client type associated with the application.
/// </summary>
[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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,6 @@ public static OpenIddictClientSystemIntegrationBuilder UseSystemIntegration(this
builder.Services.TryAddSingleton<RequireProtocolActivation>();
builder.Services.TryAddSingleton<RequireSystemBrowser>();
builder.Services.TryAddSingleton<RequireWebAuthenticationBroker>();
#pragma warning disable CS0618
builder.Services.TryAddSingleton<RequireWebAuthenticationResult>();
#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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,35 +258,6 @@ public ValueTask<bool> IsActiveAsync(BaseContext context)

return new(mode is WebAuthenticationBroker);
}
#endif
return new(false);
}
}

/// <summary>
/// Represents a filter that excludes the associated handlers if no
/// web authentication operation was triggered during the transaction.
/// </summary>
[Obsolete("This filter is obsolete and will be removed in a future version.")]
public sealed class RequireWebAuthenticationResult : IOpenIddictClientHandlerFilter<BaseContext>
{
/// <inheritdoc/>
public ValueTask<bool> 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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,29 +237,6 @@ public ValueTask HandleAsync(ProcessRequestContext context)
}
}

/// <summary>
/// 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.
/// </summary>
[Obsolete("This event handler is obsolete and will be removed in a future version.")]
public sealed class ResolveRequestUriFromWebAuthenticationResult : IOpenIddictClientHandler<ProcessRequestContext>
{
/// <summary>
/// Gets the default descriptor definition assigned to this handler.
/// </summary>
public static OpenIddictClientHandlerDescriptor Descriptor { get; }
= OpenIddictClientHandlerDescriptor.CreateBuilder<ProcessRequestContext>()
.AddFilter<RequireWebAuthenticationResult>()
.UseSingletonHandler<ResolveRequestUriFromWebAuthenticationResult>()
.SetOrder(ResolveRequestUriFromPlatformCallback.Descriptor.Order + 1_000)
.SetType(OpenIddictClientHandlerType.BuiltIn)
.Build();

/// <inheritdoc/>
public ValueTask HandleAsync(ProcessRequestContext context)
=> throw new NotSupportedException(SR.GetResourceString(SR.ID0403));
}

/// <summary>
/// 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.
Expand Down Expand Up @@ -620,30 +597,6 @@ public ValueTask HandleAsync(TContext context)
}
}

/// <summary>
/// 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.
/// </summary>
[Obsolete("This event handler is obsolete and will be removed in a future version.")]
public sealed class ExtractWebAuthenticationResultData<TContext> : IOpenIddictClientHandler<TContext> where TContext : BaseValidatingContext
{
/// <summary>
/// Gets the default descriptor definition assigned to this handler.
/// </summary>
public static OpenIddictClientHandlerDescriptor Descriptor { get; }
= OpenIddictClientHandlerDescriptor.CreateBuilder<TContext>()
.AddFilter<RequireWebAuthenticationResult>()
.UseSingletonHandler<ExtractWebAuthenticationResultData<TContext>>()
.SetOrder(ExtractPlatformCallbackParameters<TContext>.Descriptor.Order + 1_000)
.SetType(OpenIddictClientHandlerType.BuiltIn)
.Build();

/// <inheritdoc/>
public ValueTask HandleAsync(TContext context)
=> throw new NotSupportedException(SR.GetResourceString(SR.ID0403));
}

/// <summary>
/// Contains the logic responsible for waiting for the marshalled authentication operation to complete, if applicable.
/// </summary>
Expand Down Expand Up @@ -2446,42 +2399,4 @@ public ValueTask HandleAsync(TContext context)
return default;
}
}

/// <summary>
/// Contains the logic responsible for marking OpenID Connect
/// responses returned via web authentication results as processed.
/// </summary>
[Obsolete("This handler is obsolete and will be removed in a future version.")]
public sealed class ProcessWebAuthenticationResultResponse<TContext> : IOpenIddictClientHandler<TContext>
where TContext : BaseRequestContext
{
/// <summary>
/// Gets the default descriptor definition assigned to this handler.
/// </summary>
public static OpenIddictClientHandlerDescriptor Descriptor { get; }
= OpenIddictClientHandlerDescriptor.CreateBuilder<TContext>()
.AddFilter<RequireWebAuthenticationResult>()
.UseSingletonHandler<ProcessWebAuthenticationResultResponse<TContext>>()
.SetOrder(int.MaxValue)
.SetType(OpenIddictClientHandlerType.BuiltIn)
.Build();

/// <inheritdoc/>
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;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,6 @@ public static class OpenIddictClientSystemIntegrationHelpers
public static HttpListenerContext? GetHttpListenerContext(this OpenIddictClientTransaction transaction)
=> transaction.GetProperty<HttpListenerContext>(typeof(HttpListenerContext).FullName!);

#if SUPPORTS_WINDOWS_RUNTIME
/// <summary>
/// Gets the <see cref="WebAuthenticationResult"/> associated with the current context.
/// </summary>
/// <param name="transaction">The transaction instance.</param>
/// <returns>The <see cref="HttpListenerContext"/> instance or <see langword="null"/> if it couldn't be found.</returns>
[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

/// <summary>
/// Determines whether the current Windows version
/// is greater than or equals to the specified version.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<RequireHttpMetadataUri>();
#pragma warning restore CS0618
builder.Services.TryAddSingleton<RequireHttpUri>();

// Note: TryAddEnumerable() is used here to ensure the initializers are registered only once.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,6 @@ namespace OpenIddict.Client.SystemNetHttp;
[EditorBrowsable(EditorBrowsableState.Advanced)]
public static class OpenIddictClientSystemNetHttpHandlerFilters
{
/// <summary>
/// Represents a filter that excludes the associated handlers if the URI is not an HTTP or HTTPS address.
/// </summary>
[Obsolete("This filter is obsolete and will be removed in a future version.")]
public sealed class RequireHttpMetadataUri : IOpenIddictClientHandlerFilter<BaseExternalContext>
{
/// <inheritdoc/>
public ValueTask<bool> 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));
}
}

/// <summary>
/// Represents a filter that excludes the associated handlers if the URI is not an HTTP or HTTPS address.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,50 +259,6 @@ public ValueTask HandleAsync(HandleConfigurationResponseContext context)
}
}

/// <summary>
/// Contains the logic responsible for amending the client authentication methods
/// supported by the device authorization endpoint for the providers that require it.
/// </summary>
[Obsolete("This event handler is obsolete and will be removed in a future version.", error: true)]
public sealed class AmendDeviceAuthorizationEndpointClientAuthenticationMethods : IOpenIddictClientHandler<HandleConfigurationResponseContext>
{
/// <summary>
/// Gets the default descriptor definition assigned to this handler.
/// </summary>
public static OpenIddictClientHandlerDescriptor Descriptor { get; }
= OpenIddictClientHandlerDescriptor.CreateBuilder<HandleConfigurationResponseContext>()
.UseSingletonHandler<AmendDeviceAuthorizationEndpointClientAuthenticationMethods>()
.SetOrder(ExtractTokenEndpointClientAuthenticationMethods.Descriptor.Order + 500)
.SetType(OpenIddictClientHandlerType.BuiltIn)
.Build();

/// <inheritdoc/>
public ValueTask HandleAsync(HandleConfigurationResponseContext context)
=> throw new NotSupportedException(SR.GetResourceString(SR.ID0403));
}

/// <summary>
/// Contains the logic responsible for amending the client authentication
/// methods supported by the token endpoint for the providers that require it.
/// </summary>
[Obsolete("This event handler is obsolete and will be removed in a future version.", error: true)]
public sealed class AmendTokenEndpointClientAuthenticationMethods : IOpenIddictClientHandler<HandleConfigurationResponseContext>
{
/// <summary>
/// Gets the default descriptor definition assigned to this handler.
/// </summary>
public static OpenIddictClientHandlerDescriptor Descriptor { get; }
= OpenIddictClientHandlerDescriptor.CreateBuilder<HandleConfigurationResponseContext>()
.UseSingletonHandler<AmendTokenEndpointClientAuthenticationMethods>()
.SetOrder(AmendDeviceAuthorizationEndpointClientAuthenticationMethods.Descriptor.Order + 500)
.SetType(OpenIddictClientHandlerType.BuiltIn)
.Build();

/// <inheritdoc/>
public ValueTask HandleAsync(HandleConfigurationResponseContext context)
=> throw new NotSupportedException(SR.GetResourceString(SR.ID0403));
}

/// <summary>
/// Contains the logic responsible for amending the supported client
/// authentication methods for the providers that require it.
Expand Down
8 changes: 0 additions & 8 deletions src/OpenIddict.Client/OpenIddictClientConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ public sealed class OpenIddictClientConfiguration : IPostConfigureOptions<OpenId
private readonly OpenIddictClientService _service;
private readonly IServiceProvider _provider;

/// <summary>
/// Creates a new instance of the <see cref="OpenIddictClientConfiguration"/> class.
/// </summary>
/// <param name="service">The OpenIddict client service.</param>
[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));

/// <summary>
/// Creates a new instance of the <see cref="OpenIddictClientConfiguration"/> class.
/// </summary>
Expand Down
18 changes: 2 additions & 16 deletions src/OpenIddict.Client/OpenIddictClientHandlerFilters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -629,24 +629,10 @@ public ValueTask<bool> IsActiveAsync(ProcessAuthenticationContext context)
/// <summary>
/// Represents a filter that excludes the associated handlers if the WS-Federation claim mapping feature was disabled.
/// </summary>
public sealed class RequireWebServicesFederationClaimMappingEnabled :
IOpenIddictClientHandlerFilter<ProcessAuthenticationContext>,
IOpenIddictClientHandlerFilter<BaseContext>
public sealed class RequireWebServicesFederationClaimMappingEnabled : IOpenIddictClientHandlerFilter<BaseContext>
{
/// <inheritdoc/>
[Obsolete("This method is obsolete and will be removed in a future version.")]
public ValueTask<bool> IsActiveAsync(ProcessAuthenticationContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}

return new(!context.Options.DisableWebServicesFederationClaimMapping);
}

/// <inheritdoc/>
ValueTask<bool> IOpenIddictClientHandlerFilter<BaseContext>.IsActiveAsync(BaseContext context)
public ValueTask<bool> IsActiveAsync(BaseContext context)
{
if (context is null)
{
Expand Down
6 changes: 0 additions & 6 deletions src/OpenIddict.Quartz/OpenIddictQuartzConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ public sealed class OpenIddictQuartzConfiguration : IConfigureOptions<QuartzOpti
{
private readonly IServiceProvider _provider;

/// <summary>
/// Creates a new instance of the <see cref="OpenIddictQuartzConfiguration"/> class.
/// </summary>
[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));

/// <summary>
/// Creates a new instance of the <see cref="OpenIddictQuartzConfiguration"/> class.
/// </summary>
Expand Down
6 changes: 0 additions & 6 deletions src/OpenIddict.Server/OpenIddictServerConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ public sealed class OpenIddictServerConfiguration : IPostConfigureOptions<OpenId
{
private readonly IServiceProvider _provider;

/// <summary>
/// Creates a new instance of the <see cref="OpenIddictServerConfiguration"/> class.
/// </summary>
[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));

/// <summary>
/// Creates a new instance of the <see cref="OpenIddictServerConfiguration"/> class.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1068,9 +1068,6 @@ public sealed class ValidateResponseType : IOpenIddictServerHandler<ValidateAuth
{
private readonly IOpenIddictApplicationManager? _applicationManager;

[Obsolete("This constructor is no longer supported and will be removed in a future version.", error: true)]
public ValidateResponseType() => throw new NotSupportedException(SR.GetResourceString(SR.ID0403));

public ValidateResponseType(IOpenIddictApplicationManager? applicationManager = null)
=> _applicationManager = applicationManager;

Expand Down
26 changes: 0 additions & 26 deletions src/OpenIddict.Server/OpenIddictServerHandlers.Protection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1557,31 +1557,5 @@ public async ValueTask HandleAsync(GenerateTokenContext context)
}
}
}

/// <summary>
/// Contains the logic responsible for beautifying user-typed tokens.
/// Note: this handler is not used when the degraded mode is enabled.
/// </summary>
[Obsolete("This event handler is obsolete and will be removed in a future version.", error: true)]
public sealed class BeautifyToken : IOpenIddictServerHandler<GenerateTokenContext>
{
/// <summary>
/// Gets the default descriptor definition assigned to this handler.
/// </summary>
public static OpenIddictServerHandlerDescriptor Descriptor { get; }
= OpenIddictServerHandlerDescriptor.CreateBuilder<GenerateTokenContext>()
// 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<RequireDegradedModeDisabled>()
.UseSingletonHandler<BeautifyToken>()
.SetOrder(AttachTokenPayload.Descriptor.Order + 1_000)
.SetType(OpenIddictServerHandlerType.BuiltIn)
.Build();

/// <inheritdoc/>
public ValueTask HandleAsync(GenerateTokenContext context)
=> throw new NotSupportedException(SR.GetResourceString(SR.ID0403));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<RequireHttpMetadataUri>();
#pragma warning restore CS0618
builder.Services.TryAddSingleton<RequireHttpUri>();

// Note: TryAddEnumerable() is used here to ensure the initializers are registered only once.
Expand Down
Loading