Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the members obsoleted in OpenIddict 6.1 #2272

Merged
merged 1 commit into from
Mar 16, 2025
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
7 changes: 1 addition & 6 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<PackageVersion Include="Microsoft.AspNetCore.Diagnostics.Abstractions" Version="2.3.0" />
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="6.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="2.3.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.1" />
Expand Down Expand Up @@ -112,7 +111,6 @@
Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' And $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '8.0')) ">
<PackageVersion Include="EntityFramework" Version="6.5.1" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.14" />
<PackageVersion Include="Microsoft.Extensions.Caching.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.1" />
Expand Down Expand Up @@ -160,7 +158,6 @@
Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' And $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '9.0')) ">
<PackageVersion Include="EntityFramework" Version="6.5.1" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.3" />
<PackageVersion Include="Microsoft.Extensions.Caching.Abstractions" Version="9.0.3" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="9.0.3" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.3" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.3" />
Expand Down Expand Up @@ -224,7 +221,6 @@
<PackageVersion Include="Microsoft.AspNetCore.DataProtection" Version="2.3.0" />
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="6.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="2.3.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.1" />
Expand Down Expand Up @@ -273,7 +269,6 @@
<PackageVersion Include="EntityFramework" Version="6.5.1" />
<PackageVersion Include="Microsoft.AspNetCore.DataProtection" Version="2.3.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="2.3.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.1" />
Expand Down Expand Up @@ -317,7 +312,7 @@
<PackageVersion Include="NamedPipeServerStream.NetFrameworkVersion" Version="1.1.7" />

<!--
Note: OpenIddict uses PolySharp to dynamically generate polyfills for types that are not available on
Note: OpenIddict uses PolySharp to dynamically generate pstring?[]olyfills for types that are not available on
some of the targeted TFMs (e.g Index, Range or nullable attributes on .NET Framework/.NET Standard).
-->
<GlobalPackageReference Include="PolySharp" Condition=" '$(DisablePolySharp)' != 'true' " Version="1.15.0" />
Expand Down
2 changes: 0 additions & 2 deletions src/OpenIddict.Abstractions/OpenIddictConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,6 @@ public static class Parameters
public const string RefreshToken = "refresh_token";
public const string Registration = "registration";
public const string Request = "request";
[Obsolete("This property is obsolete and will be removed in a future version.")]
public const string RequestId = "request_id";
public const string RequestUri = "request_uri";
public const string Resource = "resource";
public const string ResponseMode = "response_mode";
Expand Down
25 changes: 0 additions & 25 deletions src/OpenIddict.Abstractions/OpenIddictResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -498,19 +498,6 @@ This may indicate that the event handler responsible for processing OpenID Conne
<data name="ID0115" xml:space="preserve">
<value>Only strings, booleans, integers, arrays of strings and instances of type 'OpenIddictParameter', 'JsonElement' or derived from 'JsonNode' can be returned as custom parameters.</value>
</data>
<data name="ID0116" xml:space="preserve">
<value>A distributed cache instance must be registered when enabling request caching.
To register the default in-memory distributed cache implementation, reference the 'Microsoft.Extensions.Caching.Memory' package and call 'services.AddDistributedMemoryCache()' from 'ConfigureServices'.</value>
<comment>This resource is no longer used and will be removed in a future version.</comment>
</data>
<data name="ID0117" xml:space="preserve">
<value>The authorization request payload is malformed.</value>
<comment>This resource is no longer used and will be removed in a future version.</comment>
</data>
<data name="ID0118" xml:space="preserve">
<value>The end session request payload is malformed.</value>
<comment>This resource is no longer used and will be removed in a future version.</comment>
</data>
<data name="ID0119" xml:space="preserve">
<value>The OpenIddict OWIN server handler cannot be used as an active authentication handler.
Make sure that 'OpenIddictServerOwinOptions.AuthenticationMode' is not set to 'Active'.</value>
Expand Down Expand Up @@ -1306,20 +1293,12 @@ Alternatively, you can disable the token storage feature by calling 'services.Ad
<data name="ID0340" xml:space="preserve">
<value>The endpoint type associated with the state token cannot be resolved.</value>
</data>
<data name="ID0341" xml:space="preserve">
<value>No client registration information was specified in the sign-out properties. When multiple clients are registered, an issuer, a provider name or a client registration identifier must be specified in the sign-out properties.</value>
<comment>This resource is no longer used and will be removed in a future version.</comment>
</data>
<data name="ID0342" xml:space="preserve">
<value>The same issuer cannot be used in multiple client registrations.</value>
</data>
<data name="ID0343" xml:space="preserve">
<value>The request forgery protection claim cannot be resolved from the context.</value>
</data>
<data name="ID0344" xml:space="preserve">
<value>The request forgery protection claim cannot be resolved from the sign-out context.</value>
<comment>This resource is no longer used and will be removed in a future version.</comment>
</data>
<data name="ID0345" xml:space="preserve">
<value>The product name cannot be null or empty.</value>
</data>
Expand All @@ -1344,10 +1323,6 @@ Alternatively, you can disable the token storage feature by calling 'services.Ad
<data name="ID0352" xml:space="preserve">
<value>The nonce cannot be resolved from the context.</value>
</data>
<data name="ID0353" xml:space="preserve">
<value>The nonce cannot be resolved from the sign-out context.</value>
<comment>This resource is no longer used and will be removed in a future version.</comment>
</data>
<data name="ID0354" xml:space="preserve">
<value>The nonce cannot be resolved from the state token.</value>
</data>
Expand Down
10 changes: 0 additions & 10 deletions src/OpenIddict.Abstractions/Primitives/OpenIddictRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -367,16 +367,6 @@ public string? Request
set => SetParameter(OpenIddictConstants.Parameters.Request, value);
}

/// <summary>
/// Gets or sets the "request_id" parameter.
/// </summary>
[Obsolete("This property is obsolete and will be removed in a future version.")]
public string? RequestId
{
get => (string?) GetParameter(OpenIddictConstants.Parameters.RequestId);
set => SetParameter(OpenIddictConstants.Parameters.RequestId, value);
}

/// <summary>
/// Gets or sets the "request_uri" parameter.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' Or '$(TargetFrameworkIdentifier)' == '.NETStandard' ">
<PackageReference Include="Microsoft.AspNetCore.Authentication" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.Abstractions" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

using System.ComponentModel;
using Microsoft.AspNetCore;
using Microsoft.Extensions.Caching.Distributed;
using OpenIddict.Server;
using OpenIddict.Server.AspNetCore;

namespace Microsoft.Extensions.DependencyInjection;
Expand Down Expand Up @@ -120,35 +118,6 @@ public OpenIddictServerAspNetCoreBuilder EnableTokenEndpointPassthrough()
public OpenIddictServerAspNetCoreBuilder EnableUserInfoEndpointPassthrough()
=> Configure(options => options.EnableUserInfoEndpointPassthrough = true);

/// <summary>
/// Enables authorization request caching, so that authorization requests
/// are automatically stored in the distributed cache, which allows flowing
/// large payloads across requests. Enabling this option is recommended
/// when using external authentication providers or when large GET or POST
/// OpenID Connect authorization requests support is required.
/// </summary>
/// <returns>The <see cref="OpenIddictServerAspNetCoreBuilder"/> instance.</returns>
[Obsolete("This method is obsolete and will be removed in a future version.")]
public OpenIddictServerAspNetCoreBuilder EnableAuthorizationRequestCaching()
{
Services.Configure<OpenIddictServerOptions>(options => options.EnableAuthorizationRequestCaching = true);

return this;
}

/// <summary>
/// Enables end session request caching, so that end session requests
/// are automatically stored in the distributed cache.
/// </summary>
/// <returns>The <see cref="OpenIddictServerAspNetCoreBuilder"/> instance.</returns>
[Obsolete("This method is obsolete and will be removed in a future version.")]
public OpenIddictServerAspNetCoreBuilder EnableEndSessionRequestCaching()
{
Services.Configure<OpenIddictServerOptions>(options => options.EnableEndSessionRequestCaching = true);

return this;
}

/// <summary>
/// Enables status code pages integration support. Once enabled, errors
/// generated by the interactive endpoints can be handled by ASP.NET Core.
Expand Down Expand Up @@ -179,40 +148,6 @@ public OpenIddictServerAspNetCoreBuilder SetRealm(string realm)
return Configure(options => options.Realm = realm);
}

/// <summary>
/// Sets the caching policy used by the authorization endpoint.
/// Note: the specified policy is only used when caching is explicitly enabled.
/// </summary>
/// <param name="policy">The caching policy.</param>
/// <returns>The <see cref="OpenIddictServerAspNetCoreBuilder"/> instance.</returns>
[Obsolete("This method is obsolete and will be removed in a future version.")]
public OpenIddictServerAspNetCoreBuilder SetAuthorizationRequestCachingPolicy(DistributedCacheEntryOptions policy)
{
if (policy is null)
{
throw new ArgumentNullException(nameof(policy));
}

return Configure(options => options.AuthorizationRequestCachingPolicy = policy);
}

/// <summary>
/// Sets the caching policy used by the end session endpoint.
/// Note: the specified policy is only used when caching is explicitly enabled.
/// </summary>
/// <param name="policy">The caching policy.</param>
/// <returns>The <see cref="OpenIddictServerAspNetCoreBuilder"/> instance.</returns>
[Obsolete("This method is obsolete and will be removed in a future version.")]
public OpenIddictServerAspNetCoreBuilder SetEndSessionRequestCachingPolicy(DistributedCacheEntryOptions policy)
{
if (policy is null)
{
throw new ArgumentNullException(nameof(policy));
}

return Configure(options => options.EndSessionRequestCachingPolicy = policy);
}

/// <inheritdoc/>
[EditorBrowsable(EditorBrowsableState.Never)]
public override bool Equals(object? obj) => base.Equals(obj);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,6 @@ namespace OpenIddict.Server.AspNetCore;
/// </summary>
public static class OpenIddictServerAspNetCoreConstants
{
[Obsolete("This class is obsolete and will be removed in a future version.")]
public static class Cache
{
public const string AuthorizationRequest = "openiddict-authorization-request:";
public const string EndSessionRequest = "openiddict-end_session-request:";
}

[Obsolete("This class is obsolete and will be removed in a future version.")]
public static class JsonWebTokenTypes
{
public static class Private
{
public const string AuthorizationRequest = "oi_authrq+jwt";
public const string EndSessionRequest = "oi_endsessrq+jwt";
}
}

public static class Properties
{
public const string AccessTokenPrincipal = ".access_token_principal";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ public static OpenIddictServerAspNetCoreBuilder UseAspNetCore(this OpenIddictSer
builder.Services.TryAdd(OpenIddictServerAspNetCoreHandlers.DefaultHandlers.Select(descriptor => descriptor.ServiceDescriptor));

// Register the built-in filters used by the default OpenIddict ASP.NET Core server event handlers.
#pragma warning disable CS0618
builder.Services.TryAddSingleton<RequireAuthorizationRequestCachingEnabled>();
builder.Services.TryAddSingleton<RequireEndSessionRequestCachingEnabled>();
#pragma warning restore CS0618
builder.Services.TryAddSingleton<RequireAuthorizationEndpointPassthroughEnabled>();
builder.Services.TryAddSingleton<RequireEndSessionEndpointPassthroughEnabled>();
builder.Services.TryAddSingleton<RequireErrorPassthroughEnabled>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,6 @@ namespace OpenIddict.Server.AspNetCore;
[EditorBrowsable(EditorBrowsableState.Advanced)]
public static class OpenIddictServerAspNetCoreHandlerFilters
{
/// <summary>
/// Represents a filter that excludes the associated handlers if authorization request caching was not enabled.
/// </summary>
[Obsolete("This filter is obsolete and will be removed in a future version.")]
public sealed class RequireAuthorizationRequestCachingEnabled : IOpenIddictServerHandlerFilter<BaseContext>
{
private readonly IOptionsMonitor<OpenIddictServerAspNetCoreOptions> _options;

public RequireAuthorizationRequestCachingEnabled(IOptionsMonitor<OpenIddictServerAspNetCoreOptions> options)
=> _options = options ?? throw new ArgumentNullException(nameof(options));

/// <inheritdoc/>
public ValueTask<bool> IsActiveAsync(BaseContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}

return new(_options.CurrentValue.EnableAuthorizationRequestCaching);
}
}

/// <summary>
/// Represents a filter that excludes the associated handlers if the
/// pass-through mode was not enabled for the authorization endpoint.
Expand All @@ -62,29 +39,6 @@ public ValueTask<bool> IsActiveAsync(BaseContext context)
}
}

/// <summary>
/// Represents a filter that excludes the associated handlers if end session request caching was not enabled.
/// </summary>
[Obsolete("This filter is obsolete and will be removed in a future version.")]
public sealed class RequireEndSessionRequestCachingEnabled : IOpenIddictServerHandlerFilter<BaseContext>
{
private readonly IOptionsMonitor<OpenIddictServerAspNetCoreOptions> _options;

public RequireEndSessionRequestCachingEnabled(IOptionsMonitor<OpenIddictServerAspNetCoreOptions> options)
=> _options = options ?? throw new ArgumentNullException(nameof(options));

/// <inheritdoc/>
public ValueTask<bool> IsActiveAsync(BaseContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}

return new(_options.CurrentValue.EnableEndSessionRequestCaching);
}
}

/// <summary>
/// Represents a filter that excludes the associated handlers if the
/// pass-through mode was not enabled for the end session endpoint.
Expand Down
Loading