diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 2d0414d0..2431f12c 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -45,7 +45,7 @@ jobs:
dotnet-version: |
6.0.418
7.0.405
- 8.0.101
+ 8.0.200
# Arcade only allows the revision to contain up to two characters, and GitHub Actions does not roll-over
# build numbers every day like Azure DevOps does. To balance these two requirements, set the official
@@ -105,7 +105,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
- dotnet-version: '8.0.101'
+ dotnet-version: '8.0.200'
- name: Validate NuGet packages
shell: pwsh
diff --git a/Directory.Build.targets b/Directory.Build.targets
index 7923ee0a..311eb9c9 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -117,7 +117,6 @@
$(DefineConstants);SUPPORTS_HTTP_CLIENT_RESILIENCE
- $(DefineConstants);SUPPORTS_IMMUTABLE_COLLECTIONS_MARSHAL
$(DefineConstants);SUPPORTS_TIME_PROVIDER
diff --git a/global.json b/global.json
index 271acbdc..650a86dd 100644
--- a/global.json
+++ b/global.json
@@ -1,12 +1,12 @@
{
"sdk": {
- "version": "8.0.101",
+ "version": "8.0.200",
"allowPrerelease": true,
"rollForward": "major"
},
"tools": {
- "dotnet": "8.0.101",
+ "dotnet": "8.0.200",
"runtimes": {
"aspnetcore": [
diff --git a/shared/OpenIddict.Extensions/OpenIddictPolyfills.cs b/shared/OpenIddict.Extensions/OpenIddictPolyfills.cs
deleted file mode 100644
index de45b9b6..00000000
--- a/shared/OpenIddict.Extensions/OpenIddictPolyfills.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using System.Collections.Immutable;
-using System.Runtime.CompilerServices;
-
-#if !SUPPORTS_IMMUTABLE_COLLECTIONS_MARSHAL
-namespace System.Runtime.InteropServices;
-
-internal static class ImmutableCollectionsMarshal
-{
- public static ImmutableArray AsImmutableArray(T[] array) => Unsafe.As>(ref array);
-}
-#endif
\ No newline at end of file
diff --git a/src/OpenIddict.Abstractions/OpenIddictExceptions.cs b/src/OpenIddict.Abstractions/OpenIddictExceptions.cs
index 6e65c16b..5273f53f 100644
--- a/src/OpenIddict.Abstractions/OpenIddictExceptions.cs
+++ b/src/OpenIddict.Abstractions/OpenIddictExceptions.cs
@@ -109,7 +109,7 @@ public static class OpenIddictExceptions
///
/// The exception message.
public ValidationException(string? message)
- : this(message, [])
+ : this(message, ImmutableArray.Empty)
{
}
diff --git a/src/OpenIddict.Abstractions/Primitives/OpenIddictExtensions.cs b/src/OpenIddict.Abstractions/Primitives/OpenIddictExtensions.cs
index 033a7bc1..c81d09bb 100644
--- a/src/OpenIddict.Abstractions/Primitives/OpenIddictExtensions.cs
+++ b/src/OpenIddict.Abstractions/Primitives/OpenIddictExtensions.cs
@@ -510,7 +510,7 @@ public static class OpenIddictExtensions
if (string.IsNullOrEmpty(destinations))
{
- return [];
+ return ImmutableArray.Empty;
}
using var document = JsonDocument.Parse(destinations);
@@ -620,7 +620,7 @@ public static class OpenIddictExtensions
/// The instance.
/// The destinations.
public static Claim SetDestinations(this Claim claim, IEnumerable? destinations)
- => claim.SetDestinations(destinations?.ToImmutableArray() ?? []);
+ => claim.SetDestinations(destinations?.ToImmutableArray() ?? ImmutableArray.Empty);
///
/// Adds specific destinations to a claim.
@@ -628,7 +628,7 @@ public static class OpenIddictExtensions
/// The instance.
/// The destinations.
public static Claim SetDestinations(this Claim claim, params string[]? destinations)
- => claim.SetDestinations(destinations?.ToImmutableArray() ?? []);
+ => claim.SetDestinations(destinations?.ToImmutableArray() ?? ImmutableArray.Empty);
///
/// Gets the destinations associated with all the claims of the given identity.
@@ -2868,7 +2868,7 @@ public static class OpenIddictExtensions
/// The audiences to store.
/// The claims identity.
public static ClaimsIdentity SetAudiences(this ClaimsIdentity identity, IEnumerable? audiences)
- => identity.SetAudiences(audiences?.ToImmutableArray() ?? []);
+ => identity.SetAudiences(audiences?.ToImmutableArray() ?? ImmutableArray.Empty);
///
/// Sets the audiences list in the claims principal.
@@ -2878,7 +2878,7 @@ public static class OpenIddictExtensions
/// The audiences to store.
/// The claims principal.
public static ClaimsPrincipal SetAudiences(this ClaimsPrincipal principal, IEnumerable? audiences)
- => principal.SetAudiences(audiences?.ToImmutableArray() ?? []);
+ => principal.SetAudiences(audiences?.ToImmutableArray() ?? ImmutableArray.Empty);
///
/// Sets the audiences list in the claims identity.
@@ -2888,7 +2888,7 @@ public static class OpenIddictExtensions
/// The audiences to store.
/// The claims identity.
public static ClaimsIdentity SetAudiences(this ClaimsIdentity identity, params string[]? audiences)
- => identity.SetAudiences(audiences?.ToImmutableArray() ?? []);
+ => identity.SetAudiences(audiences?.ToImmutableArray() ?? ImmutableArray.Empty);
///
/// Sets the audiences list in the claims principal.
@@ -2898,7 +2898,7 @@ public static class OpenIddictExtensions
/// The audiences to store.
/// The claims principal.
public static ClaimsPrincipal SetAudiences(this ClaimsPrincipal principal, params string[]? audiences)
- => principal.SetAudiences(audiences?.ToImmutableArray() ?? []);
+ => principal.SetAudiences(audiences?.ToImmutableArray() ?? ImmutableArray.Empty);
///
/// Sets the presenters list in the claims identity.
@@ -2928,7 +2928,7 @@ public static class OpenIddictExtensions
/// The presenters to store.
/// The claims identity.
public static ClaimsIdentity SetPresenters(this ClaimsIdentity identity, IEnumerable? presenters)
- => identity.SetPresenters(presenters?.ToImmutableArray() ?? []);
+ => identity.SetPresenters(presenters?.ToImmutableArray() ?? ImmutableArray.Empty);
///
/// Sets the presenters list in the claims principal.
@@ -2938,7 +2938,7 @@ public static class OpenIddictExtensions
/// The presenters to store.
/// The claims principal.
public static ClaimsPrincipal SetPresenters(this ClaimsPrincipal principal, IEnumerable? presenters)
- => principal.SetPresenters(presenters?.ToImmutableArray() ?? []);
+ => principal.SetPresenters(presenters?.ToImmutableArray() ?? ImmutableArray.Empty);
///
/// Sets the presenters list in the claims identity.
@@ -2948,7 +2948,7 @@ public static class OpenIddictExtensions
/// The presenters to store.
/// The claims identity.
public static ClaimsIdentity SetPresenters(this ClaimsIdentity identity, params string[]? presenters)
- => identity.SetPresenters(presenters?.ToImmutableArray() ?? []);
+ => identity.SetPresenters(presenters?.ToImmutableArray() ?? ImmutableArray.Empty);
///
/// Sets the presenters list in the claims principal.
@@ -2958,7 +2958,7 @@ public static class OpenIddictExtensions
/// The presenters to store.
/// The claims principal.
public static ClaimsPrincipal SetPresenters(this ClaimsPrincipal principal, params string[]? presenters)
- => principal.SetPresenters(presenters?.ToImmutableArray() ?? []);
+ => principal.SetPresenters(presenters?.ToImmutableArray() ?? ImmutableArray.Empty);
///
/// Sets the resources list in the claims identity.
@@ -2988,7 +2988,7 @@ public static class OpenIddictExtensions
/// The resources to store.
/// The claims identity.
public static ClaimsIdentity SetResources(this ClaimsIdentity identity, IEnumerable? resources)
- => identity.SetResources(resources?.ToImmutableArray() ?? []);
+ => identity.SetResources(resources?.ToImmutableArray() ?? ImmutableArray.Empty);
///
/// Sets the resources list in the claims principal.
@@ -2998,7 +2998,7 @@ public static class OpenIddictExtensions
/// The resources to store.
/// The claims principal.
public static ClaimsPrincipal SetResources(this ClaimsPrincipal principal, IEnumerable? resources)
- => principal.SetResources(resources?.ToImmutableArray() ?? []);
+ => principal.SetResources(resources?.ToImmutableArray() ?? ImmutableArray.Empty);
///
/// Sets the resources list in the claims identity.
@@ -3008,7 +3008,7 @@ public static class OpenIddictExtensions
/// The resources to store.
/// The claims identity.
public static ClaimsIdentity SetResources(this ClaimsIdentity identity, params string[]? resources)
- => identity.SetResources(resources?.ToImmutableArray() ?? []);
+ => identity.SetResources(resources?.ToImmutableArray() ?? ImmutableArray.Empty);
///
/// Sets the resources list in the claims principal.
@@ -3018,7 +3018,7 @@ public static class OpenIddictExtensions
/// The resources to store.
/// The claims principal.
public static ClaimsPrincipal SetResources(this ClaimsPrincipal principal, params string[]? resources)
- => principal.SetResources(resources?.ToImmutableArray() ?? []);
+ => principal.SetResources(resources?.ToImmutableArray() ?? ImmutableArray.Empty);
///
/// Sets the scopes list in the claims identity.
@@ -3048,7 +3048,7 @@ public static class OpenIddictExtensions
/// The scopes to store.
/// The claims identity.
public static ClaimsIdentity SetScopes(this ClaimsIdentity identity, IEnumerable? scopes)
- => identity.SetScopes(scopes?.ToImmutableArray() ?? []);
+ => identity.SetScopes(scopes?.ToImmutableArray() ?? ImmutableArray.Empty);
///
/// Sets the scopes list in the claims principal.
@@ -3058,7 +3058,7 @@ public static class OpenIddictExtensions
/// The scopes to store.
/// The claims principal.
public static ClaimsPrincipal SetScopes(this ClaimsPrincipal principal, IEnumerable? scopes)
- => principal.SetScopes(scopes?.ToImmutableArray() ?? []);
+ => principal.SetScopes(scopes?.ToImmutableArray() ?? ImmutableArray.Empty);
///
/// Sets the scopes list in the claims identity.
@@ -3068,7 +3068,7 @@ public static class OpenIddictExtensions
/// The scopes to store.
/// The claims identity.
public static ClaimsIdentity SetScopes(this ClaimsIdentity identity, params string[]? scopes)
- => identity.SetScopes(scopes?.ToImmutableArray() ?? []);
+ => identity.SetScopes(scopes?.ToImmutableArray() ?? ImmutableArray.Empty);
///
/// Sets the scopes list in the claims principal.
@@ -3078,7 +3078,7 @@ public static class OpenIddictExtensions
/// The scopes to store.
/// The claims principal.
public static ClaimsPrincipal SetScopes(this ClaimsPrincipal principal, params string[]? scopes)
- => principal.SetScopes(scopes?.ToImmutableArray() ?? []);
+ => principal.SetScopes(scopes?.ToImmutableArray() ?? ImmutableArray.Empty);
///
/// Sets the access token lifetime associated with the claims identity.
@@ -3266,7 +3266,7 @@ public static class OpenIddictExtensions
if (string.IsNullOrEmpty(source))
{
- return [];
+ return ImmutableArray.Empty;
}
var builder = ImmutableArray.CreateBuilder();
diff --git a/src/OpenIddict.Client.AspNetCore/OpenIddictClientAspNetCoreHandlers.Authentication.cs b/src/OpenIddict.Client.AspNetCore/OpenIddictClientAspNetCoreHandlers.Authentication.cs
index b8637fd7..b407d2fd 100644
--- a/src/OpenIddict.Client.AspNetCore/OpenIddictClientAspNetCoreHandlers.Authentication.cs
+++ b/src/OpenIddict.Client.AspNetCore/OpenIddictClientAspNetCoreHandlers.Authentication.cs
@@ -14,7 +14,7 @@ public static partial class OpenIddictClientAspNetCoreHandlers
{
public static class Authentication
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Authorization request processing:
*/
@@ -38,7 +38,7 @@ public static partial class OpenIddictClientAspNetCoreHandlers
ProcessPassthroughErrorResponse.Descriptor,
ProcessStatusCodePagesErrorResponse.Descriptor,
ProcessLocalErrorResponse.Descriptor
- ];
+ ]);
///
/// Contains the logic responsible for processing authorization requests using 302 redirects.
diff --git a/src/OpenIddict.Client.AspNetCore/OpenIddictClientAspNetCoreHandlers.Session.cs b/src/OpenIddict.Client.AspNetCore/OpenIddictClientAspNetCoreHandlers.Session.cs
index 2248000f..a91a9713 100644
--- a/src/OpenIddict.Client.AspNetCore/OpenIddictClientAspNetCoreHandlers.Session.cs
+++ b/src/OpenIddict.Client.AspNetCore/OpenIddictClientAspNetCoreHandlers.Session.cs
@@ -14,7 +14,7 @@ public static partial class OpenIddictClientAspNetCoreHandlers
{
public static class Session
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Session request processing:
*/
@@ -38,7 +38,7 @@ public static partial class OpenIddictClientAspNetCoreHandlers
ProcessPassthroughErrorResponse.Descriptor,
ProcessStatusCodePagesErrorResponse.Descriptor,
ProcessLocalErrorResponse.Descriptor
- ];
+ ]);
///
/// Contains the logic responsible for processing authorization requests using 302 redirects.
diff --git a/src/OpenIddict.Client.AspNetCore/OpenIddictClientAspNetCoreHandlers.cs b/src/OpenIddict.Client.AspNetCore/OpenIddictClientAspNetCoreHandlers.cs
index 709d96b5..a020baaa 100644
--- a/src/OpenIddict.Client.AspNetCore/OpenIddictClientAspNetCoreHandlers.cs
+++ b/src/OpenIddict.Client.AspNetCore/OpenIddictClientAspNetCoreHandlers.cs
@@ -30,7 +30,7 @@ namespace OpenIddict.Client.AspNetCore;
[EditorBrowsable(EditorBrowsableState.Never)]
public static partial class OpenIddictClientAspNetCoreHandlers
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Top-level request processing:
*/
@@ -74,7 +74,7 @@ public static partial class OpenIddictClientAspNetCoreHandlers
.. Authentication.DefaultHandlers,
.. Session.DefaultHandlers
- ];
+ ]);
///
/// Contains the logic responsible for resolving the request URI from the ASP.NET Core environment.
diff --git a/src/OpenIddict.Client.DataProtection/OpenIddictClientDataProtectionHandlers.Protection.cs b/src/OpenIddict.Client.DataProtection/OpenIddictClientDataProtectionHandlers.Protection.cs
index 9768ce20..d2600e04 100644
--- a/src/OpenIddict.Client.DataProtection/OpenIddictClientDataProtectionHandlers.Protection.cs
+++ b/src/OpenIddict.Client.DataProtection/OpenIddictClientDataProtectionHandlers.Protection.cs
@@ -21,7 +21,7 @@ public static partial class OpenIddictClientDataProtectionHandlers
{
public static class Protection
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Token validation:
*/
@@ -32,7 +32,7 @@ public static partial class OpenIddictClientDataProtectionHandlers
*/
OverrideGeneratedTokenFormat.Descriptor,
GenerateDataProtectionToken.Descriptor
- ];
+ ]);
///
/// Contains the logic responsible for validating tokens generated using Data Protection.
diff --git a/src/OpenIddict.Client.DataProtection/OpenIddictClientDataProtectionHandlers.cs b/src/OpenIddict.Client.DataProtection/OpenIddictClientDataProtectionHandlers.cs
index d66d7fd8..608da23f 100644
--- a/src/OpenIddict.Client.DataProtection/OpenIddictClientDataProtectionHandlers.cs
+++ b/src/OpenIddict.Client.DataProtection/OpenIddictClientDataProtectionHandlers.cs
@@ -13,5 +13,5 @@ namespace OpenIddict.Client.DataProtection;
public static partial class OpenIddictClientDataProtectionHandlers
{
public static ImmutableArray DefaultHandlers { get; }
- = [.. Protection.DefaultHandlers];
+ = ImmutableArray.Create([.. Protection.DefaultHandlers]);
}
diff --git a/src/OpenIddict.Client.Owin/OpenIddictClientOwinHandlers.Authentication.cs b/src/OpenIddict.Client.Owin/OpenIddictClientOwinHandlers.Authentication.cs
index fadfc77c..b4383490 100644
--- a/src/OpenIddict.Client.Owin/OpenIddictClientOwinHandlers.Authentication.cs
+++ b/src/OpenIddict.Client.Owin/OpenIddictClientOwinHandlers.Authentication.cs
@@ -13,7 +13,7 @@ public static partial class OpenIddictClientOwinHandlers
{
public static class Authentication
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Authorization request processing:
*/
@@ -38,7 +38,7 @@ public static partial class OpenIddictClientOwinHandlers
AttachCacheControlHeader.Descriptor,
ProcessPassthroughErrorResponse.Descriptor,
ProcessLocalErrorResponse.Descriptor
- ];
+ ]);
///
/// Contains the logic responsible for processing authorization requests using 302 redirects.
diff --git a/src/OpenIddict.Client.Owin/OpenIddictClientOwinHandlers.Session.cs b/src/OpenIddict.Client.Owin/OpenIddictClientOwinHandlers.Session.cs
index 8274e989..67192920 100644
--- a/src/OpenIddict.Client.Owin/OpenIddictClientOwinHandlers.Session.cs
+++ b/src/OpenIddict.Client.Owin/OpenIddictClientOwinHandlers.Session.cs
@@ -13,7 +13,7 @@ public static partial class OpenIddictClientOwinHandlers
{
public static class Session
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Session request processing:
*/
@@ -36,7 +36,7 @@ public static partial class OpenIddictClientOwinHandlers
AttachCacheControlHeader.Descriptor,
ProcessPassthroughErrorResponse.Descriptor,
ProcessLocalErrorResponse.Descriptor
- ];
+ ]);
///
/// Contains the logic responsible for processing authorization requests using 302 redirects.
diff --git a/src/OpenIddict.Client.Owin/OpenIddictClientOwinHandlers.cs b/src/OpenIddict.Client.Owin/OpenIddictClientOwinHandlers.cs
index 7f73bf24..11ac62b4 100644
--- a/src/OpenIddict.Client.Owin/OpenIddictClientOwinHandlers.cs
+++ b/src/OpenIddict.Client.Owin/OpenIddictClientOwinHandlers.cs
@@ -25,7 +25,7 @@ namespace OpenIddict.Client.Owin;
[EditorBrowsable(EditorBrowsableState.Never)]
public static partial class OpenIddictClientOwinHandlers
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Top-level request processing:
*/
@@ -68,7 +68,7 @@ public static partial class OpenIddictClientOwinHandlers
.. Authentication.DefaultHandlers,
.. Session.DefaultHandlers
- ];
+ ]);
///
/// Contains the logic responsible for resolving the request URI from the OWIN environment.
diff --git a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.Authentication.cs b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.Authentication.cs
index 9a0be002..21612bd2 100644
--- a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.Authentication.cs
+++ b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.Authentication.cs
@@ -23,7 +23,7 @@ public static partial class OpenIddictClientSystemIntegrationHandlers
{
public static class Authentication
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Authorization request processing:
*/
@@ -45,7 +45,7 @@ public static partial class OpenIddictClientSystemIntegrationHandlers
ProcessEmptyHttpResponse.Descriptor,
ProcessProtocolActivationResponse.Descriptor,
ProcessWebAuthenticationResultResponse.Descriptor
- ];
+ ]);
///
/// Contains the logic responsible for initiating authorization requests using the web authentication broker.
diff --git a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.cs b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.cs
index e72436ec..2f96061d 100644
--- a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.cs
+++ b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.cs
@@ -31,7 +31,7 @@ namespace OpenIddict.Client.SystemIntegration;
[EditorBrowsable(EditorBrowsableState.Never)]
public static partial class OpenIddictClientSystemIntegrationHandlers
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Top-level request processing:
*/
@@ -83,7 +83,7 @@ public static partial class OpenIddictClientSystemIntegrationHandlers
AbortAuthenticationDemand.Descriptor,
.. Authentication.DefaultHandlers
- ];
+ ]);
///
/// Contains the logic responsible for resolving the request URI from the HTTP listener request.
diff --git a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.Device.cs b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.Device.cs
index 87b3f56f..5e84a711 100644
--- a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.Device.cs
+++ b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.Device.cs
@@ -16,7 +16,7 @@ public static partial class OpenIddictClientSystemNetHttpHandlers
{
public static class Device
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* DeviceAuthorization request processing:
*/
@@ -39,7 +39,7 @@ public static partial class OpenIddictClientSystemNetHttpHandlers
ExtractWwwAuthenticateHeader.Descriptor,
ValidateHttpResponse.Descriptor,
DisposeHttpResponse.Descriptor
- ];
+ ]);
///
/// Contains the logic responsible for attaching the client credentials to the HTTP Authorization header.
diff --git a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.Discovery.cs b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.Discovery.cs
index 8fa41c9b..b301d43f 100644
--- a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.Discovery.cs
+++ b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.Discovery.cs
@@ -12,7 +12,7 @@ public static partial class OpenIddictClientSystemNetHttpHandlers
{
public static class Discovery
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Configuration request processing:
*/
@@ -56,6 +56,6 @@ public static partial class OpenIddictClientSystemNetHttpHandlers
ExtractWwwAuthenticateHeader.Descriptor,
ValidateHttpResponse.Descriptor,
DisposeHttpResponse.Descriptor
- ];
+ ]);
}
}
diff --git a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.Exchange.cs b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.Exchange.cs
index 951e2c4a..1c3465d0 100644
--- a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.Exchange.cs
+++ b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.Exchange.cs
@@ -16,7 +16,7 @@ public static partial class OpenIddictClientSystemNetHttpHandlers
{
public static class Exchange
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Token request processing:
*/
@@ -39,7 +39,7 @@ public static partial class OpenIddictClientSystemNetHttpHandlers
ExtractWwwAuthenticateHeader.Descriptor,
ValidateHttpResponse.Descriptor,
DisposeHttpResponse.Descriptor
- ];
+ ]);
///
/// Contains the logic responsible for attaching the client credentials to the HTTP Authorization header.
diff --git a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.Introspection.cs b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.Introspection.cs
index 3d73c758..34e8fd74 100644
--- a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.Introspection.cs
+++ b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.Introspection.cs
@@ -16,7 +16,7 @@ public static partial class OpenIddictClientSystemNetHttpHandlers
{
public static class Introspection
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Introspection request processing:
*/
@@ -39,7 +39,7 @@ public static partial class OpenIddictClientSystemNetHttpHandlers
ExtractWwwAuthenticateHeader.Descriptor,
ValidateHttpResponse.Descriptor,
DisposeHttpResponse.Descriptor
- ];
+ ]);
///
/// Contains the logic responsible for attaching the client credentials to the HTTP Authorization header.
diff --git a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.Revocation.cs b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.Revocation.cs
index 41d336f8..977c9c08 100644
--- a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.Revocation.cs
+++ b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.Revocation.cs
@@ -16,7 +16,7 @@ public static partial class OpenIddictClientSystemNetHttpHandlers
{
public static class Revocation
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Revocation request processing:
*/
@@ -40,7 +40,7 @@ public static partial class OpenIddictClientSystemNetHttpHandlers
ExtractEmptyHttpResponse.Descriptor,
ValidateHttpResponse.Descriptor,
DisposeHttpResponse.Descriptor
- ];
+ ]);
///
/// Contains the logic responsible for attaching the client credentials to the HTTP Authorization header.
diff --git a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.Userinfo.cs b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.Userinfo.cs
index 7c0b1fb3..86ca4ac6 100644
--- a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.Userinfo.cs
+++ b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.Userinfo.cs
@@ -16,7 +16,7 @@ public static partial class OpenIddictClientSystemNetHttpHandlers
{
public static class Userinfo
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Userinfo request processing:
*/
@@ -40,7 +40,7 @@ public static partial class OpenIddictClientSystemNetHttpHandlers
ExtractWwwAuthenticateHeader.Descriptor,
ValidateHttpResponse.Descriptor,
DisposeHttpResponse.Descriptor
- ];
+ ]);
///
/// Contains the logic responsible for attaching the access token to the HTTP Authorization header.
diff --git a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.cs b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.cs
index 9082cbdf..a41f22b8 100644
--- a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.cs
+++ b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.cs
@@ -21,14 +21,14 @@ namespace OpenIddict.Client.SystemNetHttp;
[EditorBrowsable(EditorBrowsableState.Never)]
public static partial class OpenIddictClientSystemNetHttpHandlers
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
.. Device.DefaultHandlers,
.. Discovery.DefaultHandlers,
.. Exchange.DefaultHandlers,
.. Introspection.DefaultHandlers,
.. Revocation.DefaultHandlers,
.. Userinfo.DefaultHandlers
- ];
+ ]);
///
/// Contains the logic responsible for creating and attaching a .
diff --git a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Authentication.cs b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Authentication.cs
index a24d8b6c..624c831c 100644
--- a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Authentication.cs
+++ b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Authentication.cs
@@ -13,12 +13,12 @@ public static partial class OpenIddictClientWebIntegrationHandlers
{
public static class Authentication
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Authorization request preparation:
*/
MapNonStandardRequestParameters.Descriptor
- ];
+ ]);
///
/// Contains the logic responsible for mapping non-standard request parameters
diff --git a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Device.cs b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Device.cs
index 876415a7..3ceef3cc 100644
--- a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Device.cs
+++ b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Device.cs
@@ -13,12 +13,12 @@ public static partial class OpenIddictClientWebIntegrationHandlers
{
public static class Device
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Token response extraction:
*/
MapNonStandardResponseParameters.Descriptor
- ];
+ ]);
///
/// Contains the logic responsible for mapping non-standard response parameters
diff --git a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Discovery.cs b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Discovery.cs
index e1f67e3c..6a9d37b7 100644
--- a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Discovery.cs
+++ b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Discovery.cs
@@ -15,7 +15,7 @@ public static partial class OpenIddictClientWebIntegrationHandlers
{
public static class Discovery
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Configuration response handling:
*/
@@ -25,7 +25,7 @@ public static partial class OpenIddictClientWebIntegrationHandlers
AmendScopes.Descriptor,
AmendClientAuthenticationMethods.Descriptor,
AmendEndpoints.Descriptor
- ];
+ ]);
///
/// Contains the logic responsible for amending the issuer for the providers that require it.
diff --git a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Exchange.cs b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Exchange.cs
index 3ab7a2e0..81dbcc9f 100644
--- a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Exchange.cs
+++ b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Exchange.cs
@@ -24,7 +24,7 @@ public static partial class OpenIddictClientWebIntegrationHandlers
{
public static class Exchange
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Token request preparation:
*/
@@ -38,7 +38,7 @@ public static partial class OpenIddictClientWebIntegrationHandlers
* Token response extraction:
*/
MapNonStandardResponseParameters.Descriptor
- ];
+ ]);
///
/// Contains the logic responsible for mapping non-standard request parameters
diff --git a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Protection.cs b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Protection.cs
index c34468bb..95f5f51a 100644
--- a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Protection.cs
+++ b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Protection.cs
@@ -14,12 +14,12 @@ public static partial class OpenIddictClientWebIntegrationHandlers
{
public static class Protection
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Token validation:
*/
AmendTokenValidationParameters.Descriptor
- ];
+ ]);
///
/// Contains the logic responsible for amending the token validation parameters for the providers that require it.
diff --git a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Revocation.cs b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Revocation.cs
index f02e80b8..e0dce7af 100644
--- a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Revocation.cs
+++ b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Revocation.cs
@@ -20,7 +20,7 @@ public static partial class OpenIddictClientWebIntegrationHandlers
{
public static class Revocation
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Revocation request preparation:
*/
@@ -30,7 +30,7 @@ public static partial class OpenIddictClientWebIntegrationHandlers
* Revocation response extraction:
*/
NormalizeContentType.Descriptor
- ];
+ ]);
///
/// Contains the logic responsible for attaching the client credentials to the HTTP Authorization
diff --git a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Userinfo.cs b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Userinfo.cs
index 0850e7b3..82403717 100644
--- a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Userinfo.cs
+++ b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Userinfo.cs
@@ -21,7 +21,7 @@ public static partial class OpenIddictClientWebIntegrationHandlers
{
public static class Userinfo
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Userinfo request preparation:
*/
@@ -36,7 +36,7 @@ public static partial class OpenIddictClientWebIntegrationHandlers
*/
NormalizeContentType.Descriptor,
UnwrapUserinfoResponse.Descriptor
- ];
+ ]);
///
/// Contains the logic responsible for overriding the HTTP method for the providers that require it.
diff --git a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs
index ce88ef40..2fe301ff 100644
--- a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs
+++ b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs
@@ -18,7 +18,7 @@ namespace OpenIddict.Client.WebIntegration;
[EditorBrowsable(EditorBrowsableState.Never)]
public static partial class OpenIddictClientWebIntegrationHandlers
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Authentication processing:
*/
@@ -62,7 +62,7 @@ public static partial class OpenIddictClientWebIntegrationHandlers
.. Protection.DefaultHandlers,
.. Revocation.DefaultHandlers,
.. Userinfo.DefaultHandlers
- ];
+ ]);
///
/// Contains the logic responsible for validating the signature or message authentication
diff --git a/src/OpenIddict.Client/OpenIddictClientHandlerDescriptor.cs b/src/OpenIddict.Client/OpenIddictClientHandlerDescriptor.cs
index 665ba4e3..fff7022a 100644
--- a/src/OpenIddict.Client/OpenIddictClientHandlerDescriptor.cs
+++ b/src/OpenIddict.Client/OpenIddictClientHandlerDescriptor.cs
@@ -31,7 +31,7 @@ public sealed class OpenIddictClientHandlerDescriptor
/// Gets the list of filters responsible for excluding the handler
/// from the activated handlers if it doesn't meet the criteria.
///
- public ImmutableArray FilterTypes { get; private set; } = [];
+ public ImmutableArray FilterTypes { get; private set; } = ImmutableArray.Empty;
///
/// Gets the order assigned to the handler.
diff --git a/src/OpenIddict.Client/OpenIddictClientHandlers.Authentication.cs b/src/OpenIddict.Client/OpenIddictClientHandlers.Authentication.cs
index 10f99fd7..5ff0cae4 100644
--- a/src/OpenIddict.Client/OpenIddictClientHandlers.Authentication.cs
+++ b/src/OpenIddict.Client/OpenIddictClientHandlers.Authentication.cs
@@ -13,7 +13,7 @@ public static partial class OpenIddictClientHandlers
{
public static class Authentication
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Authorization request top-level processing:
*/
@@ -43,7 +43,7 @@ public static partial class OpenIddictClientHandlers
* Redirection request validation:
*/
ValidateTokens.Descriptor
- ];
+ ]);
///
/// Contains the logic responsible for preparing authorization requests and invoking the corresponding event handlers.
diff --git a/src/OpenIddict.Client/OpenIddictClientHandlers.Device.cs b/src/OpenIddict.Client/OpenIddictClientHandlers.Device.cs
index 96a3cce8..8087f988 100644
--- a/src/OpenIddict.Client/OpenIddictClientHandlers.Device.cs
+++ b/src/OpenIddict.Client/OpenIddictClientHandlers.Device.cs
@@ -14,14 +14,14 @@ public static partial class OpenIddictClientHandlers
{
public static class Device
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Device authorization response handling:
*/
ValidateWellKnownParameters.Descriptor,
HandleErrorResponse.Descriptor,
ValidateVerificationEndpointUri.Descriptor
- ];
+ ]);
///
/// Contains the logic responsible for validating the well-known parameters contained in the device authorization response.
diff --git a/src/OpenIddict.Client/OpenIddictClientHandlers.Discovery.cs b/src/OpenIddict.Client/OpenIddictClientHandlers.Discovery.cs
index 1148ab2c..874de433 100644
--- a/src/OpenIddict.Client/OpenIddictClientHandlers.Discovery.cs
+++ b/src/OpenIddict.Client/OpenIddictClientHandlers.Discovery.cs
@@ -15,7 +15,7 @@ public static partial class OpenIddictClientHandlers
{
public static class Discovery
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Configuration response handling:
*/
@@ -47,7 +47,7 @@ public static partial class OpenIddictClientHandlers
ValidateWellKnownCryptographyParameters.Descriptor,
HandleCryptographyErrorResponse.Descriptor,
ExtractSigningKeys.Descriptor
- ];
+ ]);
///
/// Contains the logic responsible for validating the well-known parameters contained in the configuration response.
diff --git a/src/OpenIddict.Client/OpenIddictClientHandlers.Exchange.cs b/src/OpenIddict.Client/OpenIddictClientHandlers.Exchange.cs
index e0f49dd8..aee20ab4 100644
--- a/src/OpenIddict.Client/OpenIddictClientHandlers.Exchange.cs
+++ b/src/OpenIddict.Client/OpenIddictClientHandlers.Exchange.cs
@@ -14,13 +14,13 @@ public static partial class OpenIddictClientHandlers
{
public static class Exchange
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Token response handling:
*/
ValidateWellKnownParameters.Descriptor,
HandleErrorResponse.Descriptor
- ];
+ ]);
///
/// Contains the logic responsible for validating the well-known parameters contained in the token response.
diff --git a/src/OpenIddict.Client/OpenIddictClientHandlers.Introspection.cs b/src/OpenIddict.Client/OpenIddictClientHandlers.Introspection.cs
index f3711c8d..7030313f 100644
--- a/src/OpenIddict.Client/OpenIddictClientHandlers.Introspection.cs
+++ b/src/OpenIddict.Client/OpenIddictClientHandlers.Introspection.cs
@@ -17,7 +17,7 @@ public static partial class OpenIddictClientHandlers
{
public static class Introspection
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Introspection response handling:
*/
@@ -29,7 +29,7 @@ public static partial class OpenIddictClientHandlers
ValidateTokenUsage.Descriptor,
PopulateClaims.Descriptor,
MapInternalClaims.Descriptor
- ];
+ ]);
///
/// Contains the logic responsible for validating the well-known parameters contained in the introspection response.
@@ -513,7 +513,7 @@ public static partial class OpenIddictClientHandlers
string identifier when !string.IsNullOrEmpty(identifier)
=> ImmutableArray.Create(identifier),
- _ => []
+ _ => ImmutableArray.Empty
});
// Map the internal "oi_scp" claims from the standard, space-separated "scope" claim, if available.
@@ -521,7 +521,7 @@ public static partial class OpenIddictClientHandlers
{
string scope => scope.Split(Separators.Space, StringSplitOptions.RemoveEmptyEntries).ToImmutableArray(),
- _ => []
+ _ => ImmutableArray.Empty
});
return default;
diff --git a/src/OpenIddict.Client/OpenIddictClientHandlers.Protection.cs b/src/OpenIddict.Client/OpenIddictClientHandlers.Protection.cs
index 17b39ad3..51c69d2a 100644
--- a/src/OpenIddict.Client/OpenIddictClientHandlers.Protection.cs
+++ b/src/OpenIddict.Client/OpenIddictClientHandlers.Protection.cs
@@ -19,7 +19,7 @@ public static partial class OpenIddictClientHandlers
{
public static class Protection
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Token validation:
*/
@@ -39,7 +39,7 @@ public static partial class OpenIddictClientHandlers
CreateTokenEntry.Descriptor,
GenerateIdentityModelToken.Descriptor,
AttachTokenPayload.Descriptor
- ];
+ ]);
///
/// Contains the logic responsible for resolving the validation parameters used to validate tokens.
diff --git a/src/OpenIddict.Client/OpenIddictClientHandlers.Revocation.cs b/src/OpenIddict.Client/OpenIddictClientHandlers.Revocation.cs
index 20f5521e..05dcbf05 100644
--- a/src/OpenIddict.Client/OpenIddictClientHandlers.Revocation.cs
+++ b/src/OpenIddict.Client/OpenIddictClientHandlers.Revocation.cs
@@ -14,13 +14,13 @@ public static partial class OpenIddictClientHandlers
{
public static class Revocation
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Revocation response handling:
*/
ValidateWellKnownParameters.Descriptor,
HandleErrorResponse.Descriptor
- ];
+ ]);
///
/// Contains the logic responsible for validating the well-known parameters contained in the revocation response.
diff --git a/src/OpenIddict.Client/OpenIddictClientHandlers.Session.cs b/src/OpenIddict.Client/OpenIddictClientHandlers.Session.cs
index 16190430..966a8508 100644
--- a/src/OpenIddict.Client/OpenIddictClientHandlers.Session.cs
+++ b/src/OpenIddict.Client/OpenIddictClientHandlers.Session.cs
@@ -13,7 +13,7 @@ public static partial class OpenIddictClientHandlers
{
public static class Session
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Logout request top-level processing:
*/
@@ -38,7 +38,7 @@ public static partial class OpenIddictClientHandlers
* Post-logout redirection request validation:
*/
ValidateTokens.Descriptor
- ];
+ ]);
///
/// Contains the logic responsible for preparing authorization requests and invoking the corresponding event handlers.
diff --git a/src/OpenIddict.Client/OpenIddictClientHandlers.Userinfo.cs b/src/OpenIddict.Client/OpenIddictClientHandlers.Userinfo.cs
index 53a1aa6a..db6e758f 100644
--- a/src/OpenIddict.Client/OpenIddictClientHandlers.Userinfo.cs
+++ b/src/OpenIddict.Client/OpenIddictClientHandlers.Userinfo.cs
@@ -16,14 +16,14 @@ public static partial class OpenIddictClientHandlers
{
public static class Userinfo
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Userinfo response handling:
*/
ValidateWellKnownParameters.Descriptor,
HandleErrorResponse.Descriptor,
PopulateClaims.Descriptor
- ];
+ ]);
///
/// Contains the logic responsible for validating the well-known parameters contained in the userinfo response.
diff --git a/src/OpenIddict.Client/OpenIddictClientHandlers.cs b/src/OpenIddict.Client/OpenIddictClientHandlers.cs
index 327944d2..b35d3b6d 100644
--- a/src/OpenIddict.Client/OpenIddictClientHandlers.cs
+++ b/src/OpenIddict.Client/OpenIddictClientHandlers.cs
@@ -22,7 +22,7 @@ namespace OpenIddict.Client;
[EditorBrowsable(EditorBrowsableState.Never)]
public static partial class OpenIddictClientHandlers
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Top-level request processing:
*/
@@ -192,7 +192,7 @@ public static partial class OpenIddictClientHandlers
.. Revocation.DefaultHandlers,
.. Session.DefaultHandlers,
.. Userinfo.DefaultHandlers
- ];
+ ]);
///
/// Contains the logic responsible for inferring the endpoint type from the request URI.
diff --git a/src/OpenIddict.Client/OpenIddictClientService.cs b/src/OpenIddict.Client/OpenIddictClientService.cs
index 62400752..4eeee7d6 100644
--- a/src/OpenIddict.Client/OpenIddictClientService.cs
+++ b/src/OpenIddict.Client/OpenIddictClientService.cs
@@ -47,7 +47,7 @@ public class OpenIddictClientService
var options = _provider.GetRequiredService>();
return new(options.CurrentValue.Registrations switch
{
- [ ] => ImmutableArray.Create(),
+ [ ] => ImmutableArray.Empty,
[..] registrations => registrations.ToImmutableArray()
});
}
diff --git a/src/OpenIddict.Core/Managers/OpenIddictApplicationManager.cs b/src/OpenIddict.Core/Managers/OpenIddictApplicationManager.cs
index 7b978913..9694727d 100644
--- a/src/OpenIddict.Core/Managers/OpenIddictApplicationManager.cs
+++ b/src/OpenIddict.Core/Managers/OpenIddictApplicationManager.cs
@@ -1025,9 +1025,11 @@ public class OpenIddictApplicationManager : IOpenIddictApplication
await Store.SetDisplayNamesAsync(application, descriptor.DisplayNames.ToImmutableDictionary(), cancellationToken);
await Store.SetJsonWebKeySetAsync(application, descriptor.JsonWebKeySet, cancellationToken);
await Store.SetPermissionsAsync(application, descriptor.Permissions.ToImmutableArray(), cancellationToken);
- await Store.SetPostLogoutRedirectUrisAsync(application, [.. descriptor.PostLogoutRedirectUris.Select(uri => uri.OriginalString)], cancellationToken);
+ await Store.SetPostLogoutRedirectUrisAsync(application,
+ descriptor.PostLogoutRedirectUris.Select(uri => uri.OriginalString).ToImmutableArray(), cancellationToken);
await Store.SetPropertiesAsync(application, descriptor.Properties.ToImmutableDictionary(), cancellationToken);
- await Store.SetRedirectUrisAsync(application, [.. descriptor.RedirectUris.Select(uri => uri.OriginalString)], cancellationToken);
+ await Store.SetRedirectUrisAsync(application,
+ descriptor.RedirectUris.Select(uri => uri.OriginalString).ToImmutableArray(), cancellationToken);
await Store.SetRequirementsAsync(application, descriptor.Requirements.ToImmutableArray(), cancellationToken);
await Store.SetSettingsAsync(application, descriptor.Settings.ToImmutableDictionary(), cancellationToken);
}
@@ -1322,9 +1324,9 @@ public class OpenIddictApplicationManager : IOpenIddictApplication
// When callback URIs are specified, ensure they are valid and spec-compliant.
// See https://tools.ietf.org/html/rfc6749#section-3.1 for more information.
- foreach (var uri in ImmutableArray.Create()
- .AddRange(await Store.GetPostLogoutRedirectUrisAsync(application, cancellationToken))
- .AddRange(await Store.GetRedirectUrisAsync(application, cancellationToken)))
+ foreach (var uri in (List) [
+ .. await Store.GetPostLogoutRedirectUrisAsync(application, cancellationToken),
+ .. await Store.GetRedirectUrisAsync(application, cancellationToken)])
{
// Ensure the URI is not null or empty.
if (string.IsNullOrEmpty(uri))
diff --git a/src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkApplicationStore.cs b/src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkApplicationStore.cs
index f33a741c..941d2b7d 100644
--- a/src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkApplicationStore.cs
+++ b/src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkApplicationStore.cs
@@ -489,7 +489,7 @@ public class OpenIddictEntityFrameworkApplicationStore.Empty);
}
// Note: parsing the stringified permissions is an expensive operation.
@@ -530,7 +530,7 @@ public class OpenIddictEntityFrameworkApplicationStore.Empty);
}
// Note: parsing the stringified URIs is an expensive operation.
@@ -606,7 +606,7 @@ public class OpenIddictEntityFrameworkApplicationStore.Empty);
}
// Note: parsing the stringified URIs is an expensive operation.
@@ -647,7 +647,7 @@ public class OpenIddictEntityFrameworkApplicationStore.Empty);
}
// Note: parsing the stringified requirements is an expensive operation.
diff --git a/src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkAuthorizationStore.cs b/src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkAuthorizationStore.cs
index b92b1597..ab30ea1c 100644
--- a/src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkAuthorizationStore.cs
+++ b/src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkAuthorizationStore.cs
@@ -486,7 +486,7 @@ public class OpenIddictEntityFrameworkAuthorizationStore.Empty);
}
// Note: parsing the stringified scopes is an expensive operation.
diff --git a/src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkScopeStore.cs b/src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkScopeStore.cs
index dc1bcbc2..a81c2e3d 100644
--- a/src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkScopeStore.cs
+++ b/src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkScopeStore.cs
@@ -407,7 +407,7 @@ public class OpenIddictEntityFrameworkScopeStore : IOpen
if (string.IsNullOrEmpty(scope.Resources))
{
- return new([]);
+ return new(ImmutableArray.Empty);
}
// Note: parsing the stringified resources is an expensive operation.
diff --git a/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreApplicationStore.cs b/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreApplicationStore.cs
index 7ed453eb..756d4af1 100644
--- a/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreApplicationStore.cs
+++ b/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreApplicationStore.cs
@@ -558,7 +558,7 @@ public class OpenIddictEntityFrameworkCoreApplicationStore.Empty);
}
// Note: parsing the stringified permissions is an expensive operation.
@@ -599,7 +599,7 @@ public class OpenIddictEntityFrameworkCoreApplicationStore.Empty);
}
// Note: parsing the stringified URIs is an expensive operation.
@@ -675,7 +675,7 @@ public class OpenIddictEntityFrameworkCoreApplicationStore.Empty);
}
// Note: parsing the stringified URIs is an expensive operation.
@@ -716,7 +716,7 @@ public class OpenIddictEntityFrameworkCoreApplicationStore.Empty);
}
// Note: parsing the stringified requirements is an expensive operation.
diff --git a/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreAuthorizationStore.cs b/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreAuthorizationStore.cs
index 5a854423..b2151a02 100644
--- a/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreAuthorizationStore.cs
+++ b/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreAuthorizationStore.cs
@@ -574,7 +574,7 @@ public class OpenIddictEntityFrameworkCoreAuthorizationStore.Empty);
}
// Note: parsing the stringified scopes is an expensive operation.
diff --git a/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreScopeStore.cs b/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreScopeStore.cs
index 6436df02..fd5a876a 100644
--- a/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreScopeStore.cs
+++ b/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreScopeStore.cs
@@ -423,7 +423,7 @@ public class OpenIddictEntityFrameworkCoreScopeStore : I
if (string.IsNullOrEmpty(scope.Resources))
{
- return new([]);
+ return new(ImmutableArray.Empty);
}
// Note: parsing the stringified resources is an expensive operation.
diff --git a/src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbApplicationStore.cs b/src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbApplicationStore.cs
index d6f50c5a..2ad0585a 100644
--- a/src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbApplicationStore.cs
+++ b/src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbApplicationStore.cs
@@ -323,7 +323,7 @@ public class OpenIddictMongoDbApplicationStore : IOpenIddictApplic
if (application.Permissions is not { Count: > 0 })
{
- return new([]);
+ return new(ImmutableArray.Empty);
}
return new(application.Permissions.ToImmutableArray());
@@ -340,7 +340,7 @@ public class OpenIddictMongoDbApplicationStore : IOpenIddictApplic
if (application.PostLogoutRedirectUris is not { Count: > 0 })
{
- return new([]);
+ return new(ImmutableArray.Empty);
}
return new(application.PostLogoutRedirectUris.ToImmutableArray());
@@ -381,7 +381,7 @@ public class OpenIddictMongoDbApplicationStore : IOpenIddictApplic
if (application.RedirectUris is not { Count: > 0 })
{
- return new([]);
+ return new(ImmutableArray.Empty);
}
return new(application.RedirectUris.ToImmutableArray());
@@ -397,7 +397,7 @@ public class OpenIddictMongoDbApplicationStore : IOpenIddictApplic
if (application.Requirements is not { Count: > 0 })
{
- return new([]);
+ return new(ImmutableArray.Empty);
}
return new(application.Requirements.ToImmutableArray());
diff --git a/src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbAuthorizationStore.cs b/src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbAuthorizationStore.cs
index 233d1804..b57e126b 100644
--- a/src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbAuthorizationStore.cs
+++ b/src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbAuthorizationStore.cs
@@ -415,7 +415,7 @@ public class OpenIddictMongoDbAuthorizationStore : IOpenIddictAu
if (authorization.Scopes is not { Count: > 0 })
{
- return new([]);
+ return new(ImmutableArray.Empty);
}
return new(authorization.Scopes.ToImmutableArray());
diff --git a/src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbScopeStore.cs b/src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbScopeStore.cs
index 1a9c9f77..d0b4dfcf 100644
--- a/src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbScopeStore.cs
+++ b/src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbScopeStore.cs
@@ -302,7 +302,7 @@ public class OpenIddictMongoDbScopeStore : IOpenIddictScopeStore
if (scope.Resources is not { Count: > 0 })
{
- return new([]);
+ return new(ImmutableArray.Empty);
}
return new(scope.Resources.ToImmutableArray());
diff --git a/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Authentication.cs b/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Authentication.cs
index 1afe6cdc..f203bfd3 100644
--- a/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Authentication.cs
+++ b/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Authentication.cs
@@ -28,7 +28,7 @@ public static partial class OpenIddictServerAspNetCoreHandlers
{
public static class Authentication
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Authorization request extraction:
*/
@@ -53,7 +53,7 @@ public static partial class OpenIddictServerAspNetCoreHandlers
ProcessPassthroughErrorResponse.Descriptor,
ProcessStatusCodePagesErrorResponse.Descriptor,
ProcessLocalErrorResponse.Descriptor
- ];
+ ]);
///
/// Contains the logic responsible for restoring cached requests from the request_id, if specified.
diff --git a/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Device.cs b/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Device.cs
index 2a74055c..9e3b818c 100644
--- a/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Device.cs
+++ b/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Device.cs
@@ -14,7 +14,7 @@ public static partial class OpenIddictServerAspNetCoreHandlers
{
public static class Device
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Device request extraction:
*/
@@ -50,7 +50,7 @@ public static partial class OpenIddictServerAspNetCoreHandlers
ProcessStatusCodePagesErrorResponse.Descriptor,
ProcessLocalErrorResponse.Descriptor,
ProcessEmptyResponse.Descriptor
- ];
+ ]);
}
///
diff --git a/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Discovery.cs b/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Discovery.cs
index dea4b63d..b190cc6d 100644
--- a/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Discovery.cs
+++ b/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Discovery.cs
@@ -12,7 +12,7 @@ public static partial class OpenIddictServerAspNetCoreHandlers
{
public static class Discovery
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Configuration request extraction:
*/
@@ -36,6 +36,6 @@ public static partial class OpenIddictServerAspNetCoreHandlers
AttachHttpResponseCode.Descriptor,
AttachWwwAuthenticateHeader.Descriptor,
ProcessJsonResponse.Descriptor
- ];
+ ]);
}
}
diff --git a/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Exchange.cs b/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Exchange.cs
index 34f79c73..7c97520c 100644
--- a/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Exchange.cs
+++ b/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Exchange.cs
@@ -12,7 +12,7 @@ public static partial class OpenIddictServerAspNetCoreHandlers
{
public static class Exchange
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Token request extraction:
*/
@@ -32,6 +32,6 @@ public static partial class OpenIddictServerAspNetCoreHandlers
AttachCacheControlHeader.Descriptor,
AttachWwwAuthenticateHeader.Descriptor,
ProcessJsonResponse.Descriptor
- ];
+ ]);
}
}
diff --git a/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Introspection.cs b/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Introspection.cs
index 11c0c474..a6a67db9 100644
--- a/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Introspection.cs
+++ b/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Introspection.cs
@@ -12,7 +12,7 @@ public static partial class OpenIddictServerAspNetCoreHandlers
{
public static class Introspection
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Introspection request extraction:
*/
@@ -26,6 +26,6 @@ public static partial class OpenIddictServerAspNetCoreHandlers
AttachHttpResponseCode.Descriptor,
AttachWwwAuthenticateHeader.Descriptor,
ProcessJsonResponse.Descriptor
- ];
+ ]);
}
}
diff --git a/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Revocation.cs b/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Revocation.cs
index c81f2282..36cdcba2 100644
--- a/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Revocation.cs
+++ b/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Revocation.cs
@@ -12,7 +12,7 @@ public static partial class OpenIddictServerAspNetCoreHandlers
{
public static class Revocation
{
- public static ImmutableArray DefaultHandlers { get; } = [
+ public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([
/*
* Revocation request extraction:
*/
@@ -27,6 +27,6 @@ public static partial class OpenIddictServerAspNetCoreHandlers
AttachCacheControlHeader