Browse Source

Merge branch 'dev' into pr/2403

pull/2403/head
Kévin Chalet 4 weeks ago
parent
commit
ff4e9cfa38
  1. 8
      Directory.Build.props
  2. 34
      Directory.Build.targets
  3. 585
      Directory.Packages.props
  4. 2
      README.md
  5. 35
      gen/OpenIddict.Client.WebIntegration.Generators/OpenIddictClientWebIntegrationGenerator.cs
  6. 66
      shared/OpenIddict.Extensions/OpenIddictHelpers.cs
  7. 306
      shared/OpenIddict.Extensions/OpenIddictPolyfills.cs
  8. 5
      src/OpenIddict.Abstractions/OpenIddict.Abstractions.csproj
  9. 10
      src/OpenIddict.Client.Owin/OpenIddictClientOwinBuilder.cs
  10. 10
      src/OpenIddict.Client.Owin/OpenIddictClientOwinConfiguration.cs
  11. 16
      src/OpenIddict.Client.Owin/OpenIddictClientOwinExtensions.cs
  12. 25
      src/OpenIddict.Client.Owin/OpenIddictClientOwinHandlerFilters.cs
  13. 6
      src/OpenIddict.Client.Owin/OpenIddictClientOwinHandlers.Authentication.cs
  14. 5
      src/OpenIddict.Client.Owin/OpenIddictClientOwinHandlers.Session.cs
  15. 115
      src/OpenIddict.Client.Owin/OpenIddictClientOwinHandlers.cs
  16. 26
      src/OpenIddict.Client.Owin/OpenIddictClientOwinHelpers.cs
  17. 2
      src/OpenIddict.Client.Owin/OpenIddictClientOwinMiddleware.cs
  18. 5
      src/OpenIddict.Client.Owin/OpenIddictClientOwinMiddlewareFactory.cs
  19. 2
      src/OpenIddict.Client.SystemIntegration/OpenIddict.Client.SystemIntegration.csproj
  20. 9
      src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationConfiguration.cs
  21. 9
      src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationExtensions.cs
  22. 4
      src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHelpers.cs
  23. 1
      src/OpenIddict.Client.SystemNetHttp/OpenIddict.Client.SystemNetHttp.csproj
  24. 2
      src/OpenIddict.Client/OpenIddictClientHandlerDescriptor.cs
  25. 2
      src/OpenIddict.Client/OpenIddictClientModels.cs
  26. 2
      src/OpenIddict.Core/Managers/OpenIddictScopeManager.cs
  27. 5
      src/OpenIddict.Server.Owin/OpenIddictServerOwinBuilder.cs
  28. 10
      src/OpenIddict.Server.Owin/OpenIddictServerOwinConfiguration.cs
  29. 16
      src/OpenIddict.Server.Owin/OpenIddictServerOwinExtensions.cs
  30. 40
      src/OpenIddict.Server.Owin/OpenIddictServerOwinHandlerFilters.cs
  31. 20
      src/OpenIddict.Server.Owin/OpenIddictServerOwinHandlers.Authentication.cs
  32. 5
      src/OpenIddict.Server.Owin/OpenIddictServerOwinHandlers.Device.cs
  33. 15
      src/OpenIddict.Server.Owin/OpenIddictServerOwinHandlers.Session.cs
  34. 120
      src/OpenIddict.Server.Owin/OpenIddictServerOwinHandlers.cs
  35. 25
      src/OpenIddict.Server.Owin/OpenIddictServerOwinHelpers.cs
  36. 5
      src/OpenIddict.Server.Owin/OpenIddictServerOwinMiddlewareFactory.cs
  37. 2
      src/OpenIddict.Server/OpenIddictServerHandlerDescriptor.cs
  38. 5
      src/OpenIddict.Validation.Owin/OpenIddictValidationOwinBuilder.cs
  39. 5
      src/OpenIddict.Validation.Owin/OpenIddictValidationOwinConfiguration.cs
  40. 16
      src/OpenIddict.Validation.Owin/OpenIddictValidationOwinExtensions.cs
  41. 20
      src/OpenIddict.Validation.Owin/OpenIddictValidationOwinHandlerFilters.cs
  42. 65
      src/OpenIddict.Validation.Owin/OpenIddictValidationOwinHandlers.cs
  43. 25
      src/OpenIddict.Validation.Owin/OpenIddictValidationOwinHelpers.cs
  44. 5
      src/OpenIddict.Validation.Owin/OpenIddictValidationOwinMiddlewareFactory.cs
  45. 1
      src/OpenIddict.Validation.SystemNetHttp/OpenIddict.Validation.SystemNetHttp.csproj
  46. 2
      src/OpenIddict.Validation/OpenIddictValidationHandlerDescriptor.cs

8
Directory.Build.props

@ -21,10 +21,7 @@
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>false</CentralPackageTransitivePinningEnabled>
<RestoreEnablePackagePruning>false</RestoreEnablePackagePruning>
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
<PolyUseEmbeddedAttribute>true</PolyUseEmbeddedAttribute>
<PolyArgumentExceptions>true</PolyArgumentExceptions>
</PropertyGroup>
<PropertyGroup>
@ -37,6 +34,11 @@
<PublicKeyToken>35a561290d20de2f</PublicKeyToken>
</PropertyGroup>
<PropertyGroup>
<MeziantouPolyfill_ExcludedPolyfills>$(MeziantouPolyfill_ExcludedPolyfills);M:System.OperatingSystem.</MeziantouPolyfill_ExcludedPolyfills>
<MeziantouPolyfill_ExcludedPolyfills>$(MeziantouPolyfill_ExcludedPolyfills);T:System.Net.Http.</MeziantouPolyfill_ExcludedPolyfills>
</PropertyGroup>
<PropertyGroup Condition=" '$(DotNetRoot)' == '' ">
<DotNetRoot Condition=" '$(DOTNET_HOST_PATH)' != '' ">$([System.IO.Path]::GetDirectoryName($(DOTNET_HOST_PATH)))</DotNetRoot>
<DotNetRoot Condition=" '$(MSBuildRuntimeType)' != 'Core' ">$(ProgramFiles)\dotnet</DotNetRoot>

34
Directory.Build.targets

@ -59,12 +59,15 @@
<DefineConstants>$(DefineConstants);SUPPORTS_AUTHORIZATION_MIDDLEWARE</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_BCL_ASYNC_ENUMERABLE</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_BULK_DBSET_OPERATIONS</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_CHUNK_LINQ_EXTENSION</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_DBSET_VALUETASK_FINDASYNC</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_ENDPOINT_ROUTING</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_ENVIRONMENT_PROCESS_PATH</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_HEXADECIMAL_STRING_CONVERSION</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_HTTP_CLIENT_DEFAULT_REQUEST_VERSION</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_HTTP_CLIENT_DEFAULT_REQUEST_VERSION_POLICY</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_HTTP_CLIENT_RESILIENCE</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_INT32_RANDOM_NUMBER_GENERATOR_METHODS</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_MULTIPLE_VALUES_IN_QUERYHELPERS</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_NAMED_PIPE_STATIC_FACTORY_WITH_ACL</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_ONE_SHOT_HASHING_METHODS</DefineConstants>
@ -73,6 +76,7 @@
<DefineConstants>$(DefineConstants);SUPPORTS_PEM_ENCODED_KEY_IMPORT</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_REDIRECTION_ON_SIGN_IN</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_TEXT_ELEMENT_ENUMERATOR</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_VALUETASK_COMPLETED_TASK</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_WINFORMS_TASK_DIALOG</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_ZLIB_COMPRESSION</DefineConstants>
</PropertyGroup>
@ -155,19 +159,6 @@
<DefineConstants>$(DefineConstants);SUPPORTS_WINDOWS_RUNTIME</DefineConstants>
</PropertyGroup>
<PropertyGroup
Condition=" ('$(TargetFrameworkIdentifier)' == '.NETCore') Or
('$(TargetFrameworkIdentifier)' == '.NETFramework' And $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '4.7'))) ">
<!--
Note: Polyfill only generates the OperatingSystem APIs if the System.Runtime.InteropServices.RuntimeInformation
package is referenced. Yet, this package isn't necessary on UWP and .NET Framework 4.7+ and is deliberately not
referenced by OpenIddict due to its problematic dependencies graph. To ensure the OperatingSystem APIs are
still correctly generated, the FeatureRuntimeInformation compilation flag is manually added here.
-->
<DefineConstants>$(DefineConstants);FeatureRuntimeInformation</DefineConstants>
</PropertyGroup>
<!--
Note: Entity Framework Core 2.x references System.Interactive.Async 3.x, that includes
its own IAsyncEnumerable. To work around collisions between this type and the new type
@ -223,21 +214,4 @@
<Target Name="_CalculateXbfSupport"
Condition=" '$(TargetFrameworkIdentifier)' == '.NETCore' And '$(TargetPlatformIdentifier)' == 'UAP' " />
<!--
Note: Polyfill internally references RequiredMemberAttribute without using "global::", which collides with
the type of the same name exposed by the iOS/Mac Catalyst/macOS reference assemblies. To work around that,
the RequiredMemberAttribute.cs file imported by Polyfill is excluded from compilation on these platforms.
-->
<Target Name="RemoveRequiredMemberAttribute" BeforeTargets="CoreCompile">
<ItemGroup Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' And
('$(TargetPlatformIdentifier)' == 'iOS' Or
'$(TargetPlatformIdentifier)' == 'MacCatalyst' Or
'$(TargetPlatformIdentifier)' == 'macOS' ) ">
<Compile Remove="@(Compile)"
Condition=" %(Compile.NuGetPackageId) == 'Polyfill' And
'%(Compile.Filename)%(Compile.Extension)' == 'RequiredMemberAttribute.cs' " />
</ItemGroup>
</Target>
</Project>

585
Directory.Packages.props

@ -20,39 +20,40 @@
<ItemGroup Label="Package versions for .NET Framework 4.6.2"
Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' And $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '4.6.2')) ">
<PackageVersion Include="BouncyCastle.Cryptography" Version="2.6.2" />
<PackageVersion Include="EntityFramework" Version="6.5.1" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication" Version="2.3.0" />
<PackageVersion Include="Microsoft.AspNetCore.DataProtection" Version="2.3.0" />
<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.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" />
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="8.0.21" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Primitives" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.WebEncoders" Version="8.0.21" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Protocols" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Tokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="2.3.4" />
<PackageVersion Include="Microsoft.Owin.Security" Version="4.2.3" />
<PackageVersion Include="Microsoft.Windows.SDK.Contracts" Version="10.0.17763.1000" />
<PackageVersion Include="MongoDB.Bson" Version="3.5.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.5.0" />
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="3.15.1" />
<PackageVersion Include="System.Collections.Immutable" Version="8.0.0" />
<PackageVersion Include="System.Interactive.Async" Version="3.2.0" />
<PackageVersion Include="System.Net.Http.Json" Version="8.0.1" />
<PackageVersion Include="BouncyCastle.Cryptography" Version="2.6.2" />
<PackageVersion Include="EntityFramework" Version="6.5.1" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication" Version="2.3.0" />
<PackageVersion Include="Microsoft.AspNetCore.DataProtection" Version="2.3.0" />
<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.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" />
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="8.0.21" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Primitives" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.WebEncoders" Version="8.0.21" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Protocols" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Tokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="2.3.4" />
<PackageVersion Include="Microsoft.Owin.Security" Version="4.2.3" />
<PackageVersion Include="Microsoft.Windows.SDK.Contracts" Version="10.0.17763.1000" />
<PackageVersion Include="MongoDB.Bson" Version="3.5.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.5.0" />
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="3.15.1" />
<PackageVersion Include="System.Collections.Immutable" Version="8.0.0" />
<PackageVersion Include="System.Interactive.Async" Version="3.2.0" />
<PackageVersion Include="System.Net.Http.Json" Version="8.0.1" />
<PackageVersion Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
<!--
Note: OpenIddict uses Polyfill to dynamically generate polyfills for types that are not available on
some of the targeted TFMs (e.g Index, Range or nullable attributes on .NET Framework/.NET Standard).
Note: OpenIddict uses Meziantou.Polyfill to dynamically generate polyfills 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="Polyfill" Condition=" '$(IncludePolyfills)' != 'false' " Version="9.5.0" />
<GlobalPackageReference Include="Meziantou.Polyfill" Condition=" '$(IncludePolyfills)' != 'false' " Version="1.0.83" />
</ItemGroup>
<!--
@ -65,51 +66,51 @@
<ItemGroup Label="Package versions for .NET Framework 4.7.2"
Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' And $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '4.7.2')) ">
<PackageVersion Include="BouncyCastle.Cryptography" Version="2.6.2" />
<PackageVersion Include="EntityFramework" Version="6.5.1" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication" Version="2.3.0" />
<PackageVersion Include="Microsoft.AspNetCore.DataProtection" Version="2.3.0" />
<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.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" />
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="8.0.21" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Primitives" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.WebEncoders" Version="8.0.21" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Protocols" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Tokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="2.3.4" />
<PackageVersion Include="Microsoft.Owin.Security" Version="4.2.3" />
<PackageVersion Include="Microsoft.Windows.SDK.Contracts" Version="10.0.17763.1000" />
<PackageVersion Include="MongoDB.Bson" Version="3.5.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.5.0" />
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="3.15.1" />
<PackageVersion Include="System.Collections.Immutable" Version="8.0.0" />
<PackageVersion Include="System.Interactive.Async" Version="3.2.0" />
<PackageVersion Include="System.Net.Http.Json" Version="8.0.1" />
<PackageVersion Include="BouncyCastle.Cryptography" Version="2.6.2" />
<PackageVersion Include="EntityFramework" Version="6.5.1" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication" Version="2.3.0" />
<PackageVersion Include="Microsoft.AspNetCore.DataProtection" Version="2.3.0" />
<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.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" />
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="8.0.21" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Primitives" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.WebEncoders" Version="8.0.21" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Protocols" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Tokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="2.3.4" />
<PackageVersion Include="Microsoft.Owin.Security" Version="4.2.3" />
<PackageVersion Include="Microsoft.Windows.SDK.Contracts" Version="10.0.17763.1000" />
<PackageVersion Include="MongoDB.Bson" Version="3.5.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.5.0" />
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="3.15.1" />
<PackageVersion Include="System.Collections.Immutable" Version="8.0.0" />
<PackageVersion Include="System.Interactive.Async" Version="3.2.0" />
<PackageVersion Include="System.Net.Http.Json" Version="8.0.1" />
<!--
Note: the following references are exclusively used in the test projects:
-->
<PackageVersion Include="AngleSharp" Version="1.3.0" />
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.6.0" />
<PackageVersion Include="Microsoft.AspNetCore.Server.Kestrel.Core" Version="2.3.6" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="2.3.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageVersion Include="Microsoft.Owin.Testing" Version="4.2.3" />
<PackageVersion Include="Moq" Version="4.18.4" />
<PackageVersion Include="System.Linq.Async" Version="6.0.3" />
<PackageVersion Include="AngleSharp" Version="1.3.0" />
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.6.0" />
<PackageVersion Include="Microsoft.AspNetCore.Server.Kestrel.Core" Version="2.3.6" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="2.3.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageVersion Include="Microsoft.Owin.Testing" Version="4.2.3" />
<PackageVersion Include="Moq" Version="4.18.4" />
<PackageVersion Include="System.Linq.Async" Version="6.0.3" />
<!--
Note: OpenIddict uses Polyfill to dynamically generate polyfills for types that are not available on
some of the targeted TFMs (e.g Index, Range or nullable attributes on .NET Framework/.NET Standard).
Note: OpenIddict uses Meziantou.Polyfill to dynamically generate polyfills 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="Polyfill" Condition=" '$(IncludePolyfills)' != 'false' " Version="9.5.0" />
<GlobalPackageReference Include="Meziantou.Polyfill" Condition=" '$(IncludePolyfills)' != 'false' " Version="1.0.83" />
</ItemGroup>
<!--
@ -122,86 +123,86 @@
<ItemGroup Label="Package versions for .NET Framework 4.8"
Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' And $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '4.8.0')) ">
<PackageVersion Include="BouncyCastle.Cryptography" Version="2.6.2" />
<PackageVersion Include="EntityFramework" Version="6.5.1" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication" Version="2.3.0" />
<PackageVersion Include="Microsoft.AspNetCore.DataProtection" Version="2.3.0" />
<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.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" />
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="8.0.21" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Primitives" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.WebEncoders" Version="8.0.21" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Protocols" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Tokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="2.3.4" />
<PackageVersion Include="Microsoft.Owin.Security" Version="4.2.3" />
<PackageVersion Include="Microsoft.Windows.SDK.Contracts" Version="10.0.17763.1000" />
<PackageVersion Include="MongoDB.Bson" Version="3.5.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.5.0" />
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="3.15.1" />
<PackageVersion Include="System.Collections.Immutable" Version="8.0.0" />
<PackageVersion Include="System.Interactive.Async" Version="3.2.0" />
<PackageVersion Include="System.Net.Http.Json" Version="8.0.1" />
<PackageVersion Include="BouncyCastle.Cryptography" Version="2.6.2" />
<PackageVersion Include="EntityFramework" Version="6.5.1" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication" Version="2.3.0" />
<PackageVersion Include="Microsoft.AspNetCore.DataProtection" Version="2.3.0" />
<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.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" />
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="8.0.21" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Primitives" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.WebEncoders" Version="8.0.21" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Protocols" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Tokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="2.3.4" />
<PackageVersion Include="Microsoft.Owin.Security" Version="4.2.3" />
<PackageVersion Include="Microsoft.Windows.SDK.Contracts" Version="10.0.17763.1000" />
<PackageVersion Include="MongoDB.Bson" Version="3.5.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.5.0" />
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="3.15.1" />
<PackageVersion Include="System.Collections.Immutable" Version="8.0.0" />
<PackageVersion Include="System.Interactive.Async" Version="3.2.0" />
<PackageVersion Include="System.Net.Http.Json" Version="8.0.1" />
<!--
Note: the following references are exclusively used in the test projects:
-->
<PackageVersion Include="AngleSharp" Version="1.3.0" />
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.6.0" />
<PackageVersion Include="Microsoft.AspNetCore.Server.Kestrel.Core" Version="2.3.6" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="2.3.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageVersion Include="Microsoft.Owin.Testing" Version="4.2.3" />
<PackageVersion Include="Moq" Version="4.18.4" />
<PackageVersion Include="System.Linq.Async" Version="6.0.3" />
<PackageVersion Include="AngleSharp" Version="1.3.0" />
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.6.0" />
<PackageVersion Include="Microsoft.AspNetCore.Server.Kestrel.Core" Version="2.3.6" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="2.3.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageVersion Include="Microsoft.Owin.Testing" Version="4.2.3" />
<PackageVersion Include="Moq" Version="4.18.4" />
<PackageVersion Include="System.Linq.Async" Version="6.0.3" />
<!--
Note: the following references are exclusively used in the samples:
-->
<PackageVersion Include="Antlr" Version="3.5.0.2" />
<PackageVersion Include="Autofac.Extensions.DependencyInjection" Version="10.0.0" />
<PackageVersion Include="Autofac.Mvc5" Version="6.1.0" />
<PackageVersion Include="Autofac.Owin" Version="7.1.0" />
<PackageVersion Include="Autofac.WebApi2.Owin" Version="6.2.1" />
<PackageVersion Include="Dapplo.Microsoft.Extensions.Hosting.AppServices" Version="1.0.14" />
<PackageVersion Include="Dapplo.Microsoft.Extensions.Hosting.WinForms" Version="1.0.14" />
<PackageVersion Include="Dapplo.Microsoft.Extensions.Hosting.Wpf" Version="1.0.14" />
<PackageVersion Include="Microsoft.AspNet.Identity.EntityFramework" Version="2.2.4" />
<PackageVersion Include="Microsoft.AspNet.Identity.Owin" Version="2.2.4" />
<PackageVersion Include="Microsoft.AspNet.Mvc" Version="5.3.0" />
<PackageVersion Include="Microsoft.AspNet.Web.Optimization" Version="1.1.3" />
<PackageVersion Include="Microsoft.AspNet.WebApi.Owin" Version="5.3.0" />
<PackageVersion Include="Microsoft.AspNetCore" Version="2.3.0" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Cookies" Version="2.3.0" />
<PackageVersion Include="Microsoft.AspNetCore.Identity" Version="2.3.1" />
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.3.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc" Version="2.3.0" />
<PackageVersion Include="Microsoft.AspNetCore.StaticFiles" Version="2.3.0" />
<PackageVersion Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" Version="4.1.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.3.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
<PackageVersion Include="Microsoft.Net.Compilers.Toolset" Version="4.14.0" />
<PackageVersion Include="Microsoft.Owin.Host.SystemWeb" Version="4.2.3" />
<PackageVersion Include="Microsoft.Owin.Security.Cookies" Version="4.2.3" />
<PackageVersion Include="Microsoft.Owin.Security.OAuth" Version="4.2.3" />
<PackageVersion Include="Microsoft.Web.Infrastructure" Version="2.0.1" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.4" />
<PackageVersion Include="Quartz.Extensions.Hosting" Version="3.15.1" />
<PackageVersion Include="Spectre.Console" Version="0.53.0" />
<PackageVersion Include="WebGrease" Version="1.6.0" />
<PackageVersion Include="Antlr" Version="3.5.0.2" />
<PackageVersion Include="Autofac.Extensions.DependencyInjection" Version="10.0.0" />
<PackageVersion Include="Autofac.Mvc5" Version="6.1.0" />
<PackageVersion Include="Autofac.Owin" Version="7.1.0" />
<PackageVersion Include="Autofac.WebApi2.Owin" Version="6.2.1" />
<PackageVersion Include="Dapplo.Microsoft.Extensions.Hosting.AppServices" Version="1.0.14" />
<PackageVersion Include="Dapplo.Microsoft.Extensions.Hosting.WinForms" Version="1.0.14" />
<PackageVersion Include="Dapplo.Microsoft.Extensions.Hosting.Wpf" Version="1.0.14" />
<PackageVersion Include="Microsoft.AspNet.Identity.EntityFramework" Version="2.2.4" />
<PackageVersion Include="Microsoft.AspNet.Identity.Owin" Version="2.2.4" />
<PackageVersion Include="Microsoft.AspNet.Mvc" Version="5.3.0" />
<PackageVersion Include="Microsoft.AspNet.Web.Optimization" Version="1.1.3" />
<PackageVersion Include="Microsoft.AspNet.WebApi.Owin" Version="5.3.0" />
<PackageVersion Include="Microsoft.AspNetCore" Version="2.3.0" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Cookies" Version="2.3.0" />
<PackageVersion Include="Microsoft.AspNetCore.Identity" Version="2.3.1" />
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.3.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc" Version="2.3.0" />
<PackageVersion Include="Microsoft.AspNetCore.StaticFiles" Version="2.3.0" />
<PackageVersion Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" Version="4.1.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.3.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
<PackageVersion Include="Microsoft.Net.Compilers.Toolset" Version="4.14.0" />
<PackageVersion Include="Microsoft.Owin.Host.SystemWeb" Version="4.2.3" />
<PackageVersion Include="Microsoft.Owin.Security.Cookies" Version="4.2.3" />
<PackageVersion Include="Microsoft.Owin.Security.OAuth" Version="4.2.3" />
<PackageVersion Include="Microsoft.Web.Infrastructure" Version="2.0.1" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.4" />
<PackageVersion Include="Quartz.Extensions.Hosting" Version="3.15.1" />
<PackageVersion Include="Spectre.Console" Version="0.53.0" />
<PackageVersion Include="WebGrease" Version="1.6.0" />
<!--
Note: OpenIddict uses Polyfill to dynamically generate polyfills for types that are not available on
some of the targeted TFMs (e.g Index, Range or nullable attributes on .NET Framework/.NET Standard).
Note: OpenIddict uses Meziantou.Polyfill to dynamically generate polyfills 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="Polyfill" Condition=" '$(IncludePolyfills)' != 'false' " Version="9.5.0" />
<GlobalPackageReference Include="Meziantou.Polyfill" Condition=" '$(IncludePolyfills)' != 'false' " Version="1.0.83" />
</ItemGroup>
<!--
@ -214,41 +215,41 @@
<ItemGroup Label="Package versions for .NET 8.0"
Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' And $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '8.0')) ">
<PackageVersion Include="EntityFramework" Version="6.5.1" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.21" />
<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" />
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="8.0.21" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="8.10.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Primitives" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.WebEncoders" Version="8.0.21" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Protocols" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Tokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="8.0.21" />
<PackageVersion Include="MongoDB.Bson" Version="3.5.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.5.0" />
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="3.15.1" />
<PackageVersion Include="Xamarin.AndroidX.Browser" Version="1.9.0" />
<PackageVersion Include="EntityFramework" Version="6.5.1" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.21" />
<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" />
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="8.0.21" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="8.10.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Primitives" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.WebEncoders" Version="8.0.21" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Protocols" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Tokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="8.0.21" />
<PackageVersion Include="MongoDB.Bson" Version="3.5.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.5.0" />
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="3.15.1" />
<PackageVersion Include="Xamarin.AndroidX.Browser" Version="1.9.0" />
<!--
Note: the following references are exclusively used in the test projects:
-->
<PackageVersion Include="AngleSharp" Version="1.3.0" />
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.6.0" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="8.0.21" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageVersion Include="Moq" Version="4.18.4" />
<PackageVersion Include="System.Linq.Async" Version="6.0.3" />
<PackageVersion Include="AngleSharp" Version="1.3.0" />
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.6.0" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="8.0.21" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageVersion Include="Moq" Version="4.18.4" />
<PackageVersion Include="System.Linq.Async" Version="6.0.3" />
<!--
Note: OpenIddict uses Polyfill to dynamically generate polyfills for types that are not available on
some of the targeted TFMs (e.g Index, Range or nullable attributes on .NET Framework/.NET Standard).
Note: OpenIddict uses Meziantou.Polyfill to dynamically generate polyfills 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="Polyfill" Condition=" '$(IncludePolyfills)' != 'false' " Version="9.5.0" />
<GlobalPackageReference Include="Meziantou.Polyfill" Condition=" '$(IncludePolyfills)' != 'false' " Version="1.0.83" />
</ItemGroup>
<!--
@ -261,40 +262,40 @@
<ItemGroup Label="Package versions for .NET 9.0"
Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' And $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '9.0')) ">
<PackageVersion Include="EntityFramework" Version="6.5.1" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="9.10.0" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Protocols" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Tokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Primitives" Version="9.0.10" />
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="9.0.10" />
<PackageVersion Include="MongoDB.Bson" Version="3.5.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.5.0" />
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="3.15.1" />
<PackageVersion Include="Xamarin.AndroidX.Browser" Version="1.9.0" />
<PackageVersion Include="EntityFramework" Version="6.5.1" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="9.10.0" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Protocols" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Tokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Primitives" Version="9.0.10" />
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="9.0.10" />
<PackageVersion Include="MongoDB.Bson" Version="3.5.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.5.0" />
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="3.15.1" />
<PackageVersion Include="Xamarin.AndroidX.Browser" Version="1.9.0" />
<!--
Note: the following references are exclusively used in the test projects:
-->
<PackageVersion Include="AngleSharp" Version="1.3.0" />
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.6.0" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.10" />
<PackageVersion Include="Moq" Version="4.18.4" />
<PackageVersion Include="System.Linq.Async" Version="6.0.3" />
<PackageVersion Include="AngleSharp" Version="1.3.0" />
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.6.0" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.10" />
<PackageVersion Include="Moq" Version="4.18.4" />
<PackageVersion Include="System.Linq.Async" Version="6.0.3" />
<!--
Note: OpenIddict uses Polyfill to dynamically generate polyfills for types that are not available on
some of the targeted TFMs (e.g Index, Range or nullable attributes on .NET Framework/.NET Standard).
Note: OpenIddict uses Meziantou.Polyfill to dynamically generate polyfills 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="Polyfill" Condition=" '$(IncludePolyfills)' != 'false' " Version="9.5.0" />
<GlobalPackageReference Include="Meziantou.Polyfill" Condition=" '$(IncludePolyfills)' != 'false' " Version="1.0.83" />
</ItemGroup>
<!--
@ -307,53 +308,53 @@
<ItemGroup Label="Package versions for .NET 10.0"
Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' And $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '10.0')) ">
<PackageVersion Include="EntityFramework" Version="6.5.1" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="10.0.0" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Protocols" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Tokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Primitives" Version="10.0.0" />
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="10.0.0" />
<PackageVersion Include="MongoDB.Bson" Version="3.5.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.5.0" />
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="3.15.1" />
<PackageVersion Include="Xamarin.AndroidX.Browser" Version="1.9.0" />
<PackageVersion Include="EntityFramework" Version="6.5.1" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="10.0.0" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Protocols" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Tokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Primitives" Version="10.0.0" />
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="10.0.0" />
<PackageVersion Include="MongoDB.Bson" Version="3.5.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.5.0" />
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="3.15.1" />
<PackageVersion Include="Xamarin.AndroidX.Browser" Version="1.9.0" />
<!--
Note: the following references are exclusively used in the test projects:
-->
<PackageVersion Include="AngleSharp" Version="1.3.0" />
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.6.0" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.0" />
<PackageVersion Include="Moq" Version="4.18.4" />
<PackageVersion Include="AngleSharp" Version="1.3.0" />
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.6.0" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.0" />
<PackageVersion Include="Moq" Version="4.18.4" />
<!--
Note: the following references are exclusively used in the samples:
-->
<PackageVersion Include="Dapplo.Microsoft.Extensions.Hosting.AppServices" Version="1.0.14" />
<PackageVersion Include="Dapplo.Microsoft.Extensions.Hosting.WinForms" Version="1.0.14" />
<PackageVersion Include="Dapplo.Microsoft.Extensions.Hosting.Wpf" Version="1.0.14" />
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="10.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.0" />
<PackageVersion Include="Microsoft.Maui.Controls" Version="10.0.0" />
<PackageVersion Include="Microsoft.Maui.Controls.Compatibility" Version="10.0.0" />
<PackageVersion Include="Quartz.Extensions.Hosting" Version="3.15.1" />
<PackageVersion Include="Spectre.Console" Version="0.53.0" />
<PackageVersion Include="Dapplo.Microsoft.Extensions.Hosting.AppServices" Version="1.0.14" />
<PackageVersion Include="Dapplo.Microsoft.Extensions.Hosting.WinForms" Version="1.0.14" />
<PackageVersion Include="Dapplo.Microsoft.Extensions.Hosting.Wpf" Version="1.0.14" />
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="10.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.0" />
<PackageVersion Include="Microsoft.Maui.Controls" Version="10.0.0" />
<PackageVersion Include="Microsoft.Maui.Controls.Compatibility" Version="10.0.0" />
<PackageVersion Include="Quartz.Extensions.Hosting" Version="3.15.1" />
<PackageVersion Include="Spectre.Console" Version="0.53.0" />
<!--
Note: OpenIddict uses Polyfill to dynamically generate polyfills for types that are not available on
some of the targeted TFMs (e.g Index, Range or nullable attributes on .NET Framework/.NET Standard).
Note: OpenIddict uses Meziantou.Polyfill to dynamically generate polyfills 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="Polyfill" Condition=" '$(IncludePolyfills)' != 'false' " Version="9.5.0" />
<GlobalPackageReference Include="Meziantou.Polyfill" Condition=" '$(IncludePolyfills)' != 'false' " Version="1.0.83" />
</ItemGroup>
<!--
@ -366,45 +367,45 @@
<ItemGroup Label="Package versions for .NET Standard 2.0"
Condition=" '$(TargetFrameworkIdentifier)' == '.NETStandard' And $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '2.0')) ">
<PackageVersion Include="BouncyCastle.Cryptography" Version="2.6.2" />
<PackageVersion Include="EntityFramework" Version="6.5.1" />
<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.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" />
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="8.0.21" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Primitives" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.WebEncoders" Version="8.0.21" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Protocols" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Tokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="2.3.4" />
<PackageVersion Include="MongoDB.Bson" Version="3.5.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.5.0" />
<PackageVersion Include="NamedPipeServerStream.NetFrameworkVersion" Version="1.1.13" />
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="3.15.1" />
<PackageVersion Include="System.Collections.Immutable" Version="8.0.0" />
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageVersion Include="System.Interactive.Async" Version="3.2.0" />
<PackageVersion Include="System.Net.Http.Json" Version="8.0.1" />
<PackageVersion Include="BouncyCastle.Cryptography" Version="2.6.2" />
<PackageVersion Include="EntityFramework" Version="6.5.1" />
<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.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" />
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="8.0.21" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Primitives" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.WebEncoders" Version="8.0.21" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Protocols" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Tokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="2.3.4" />
<PackageVersion Include="MongoDB.Bson" Version="3.5.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.5.0" />
<PackageVersion Include="NamedPipeServerStream.NetFrameworkVersion" Version="1.1.13" />
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="3.15.1" />
<PackageVersion Include="System.Collections.Immutable" Version="8.0.0" />
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageVersion Include="System.Interactive.Async" Version="3.2.0" />
<PackageVersion Include="System.Net.Http.Json" Version="8.0.1" />
<!--
Note: the following references are exclusively used in the source generators:
-->
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" />
<PackageVersion Include="Scriban" Version="6.5.0" />
<PackageVersion Include="System.Interactive" Version="6.0.3" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" />
<PackageVersion Include="Scriban" Version="6.5.0" />
<PackageVersion Include="System.Interactive" Version="6.0.3" />
<!--
Note: OpenIddict uses Polyfill to dynamically generate polyfills for types that are not available on
some of the targeted TFMs (e.g Index, Range or nullable attributes on .NET Framework/.NET Standard).
Note: OpenIddict uses Meziantou.Polyfill to dynamically generate polyfills 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="Polyfill" Condition=" '$(IncludePolyfills)' != 'false' " Version="9.5.0" />
<GlobalPackageReference Include="Meziantou.Polyfill" Condition=" '$(IncludePolyfills)' != 'false' " Version="1.0.83" />
</ItemGroup>
<!--
@ -417,35 +418,35 @@
<ItemGroup Label="Package versions for .NET Standard 2.1"
Condition=" '$(TargetFrameworkIdentifier)' == '.NETStandard' And $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '2.1')) ">
<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.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" />
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="8.0.21" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Primitives" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.WebEncoders" Version="8.0.21" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Protocols" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Tokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="2.3.4" />
<PackageVersion Include="MongoDB.Bson" Version="3.5.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.5.0" />
<PackageVersion Include="NamedPipeServerStream.NetFrameworkVersion" Version="1.1.13" />
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="3.15.1" />
<PackageVersion Include="System.Collections.Immutable" Version="8.0.0" />
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageVersion Include="System.Interactive.Async" Version="3.2.0" />
<PackageVersion Include="System.Net.Http.Json" Version="8.0.1" />
<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.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" />
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="8.0.21" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Primitives" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.WebEncoders" Version="8.0.21" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Protocols" Version="8.14.0" />
<PackageVersion Include="Microsoft.IdentityModel.Tokens" Version="8.14.0" />
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="2.3.4" />
<PackageVersion Include="MongoDB.Bson" Version="3.5.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.5.0" />
<PackageVersion Include="NamedPipeServerStream.NetFrameworkVersion" Version="1.1.13" />
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="3.15.1" />
<PackageVersion Include="System.Collections.Immutable" Version="8.0.0" />
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageVersion Include="System.Interactive.Async" Version="3.2.0" />
<PackageVersion Include="System.Net.Http.Json" Version="8.0.1" />
<!--
Note: OpenIddict uses Polyfill to dynamically generate polyfills for types that are not available on
some of the targeted TFMs (e.g Index, Range or nullable attributes on .NET Framework/.NET Standard).
Note: OpenIddict uses Meziantou.Polyfill to dynamically generate polyfills 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="Polyfill" Condition=" '$(IncludePolyfills)' != 'false' " Version="9.5.0" />
<GlobalPackageReference Include="Meziantou.Polyfill" Condition=" '$(IncludePolyfills)' != 'false' " Version="1.0.83" />
</ItemGroup>
<!--
@ -459,15 +460,15 @@
<ItemGroup Label="Package versions for Universal Windows Platform 10.0.17763"
Condition=" '$(TargetFrameworkIdentifier)' == '.NETCore' And $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '5.0')) And
'$(TargetPlatformIdentifier)' == 'UAP' And $([MSBuild]::VersionEquals($(TargetPlatformVersion), '10.0.17763')) ">
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.1" />
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="2.3.4" />
<PackageVersion Include="NamedPipeServerStream.NetFrameworkVersion" Version="1.1.7" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.1" />
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="2.3.4" />
<PackageVersion Include="NamedPipeServerStream.NetFrameworkVersion" Version="1.1.7" />
<!--
Note: OpenIddict uses Polyfill 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).
Note: OpenIddict uses Meziantou.Polyfill to dynamically generate polyfills 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="Polyfill" Condition=" '$(IncludePolyfills)' != 'false' " Version="9.5.0" />
<GlobalPackageReference Include="Meziantou.Polyfill" Condition=" '$(IncludePolyfills)' != 'false' " Version="1.0.83" />
</ItemGroup>
</Project>

2
README.md

@ -183,7 +183,7 @@ To reference the OpenIddict MyGet feed, **create a `NuGet.config` file** (at the
<br />
<br />
<!-- sponsors --><a href="https://github.com/sebastienros"><img src="https://github.com/sebastienros.png" width="60px" alt="Sébastien Ros" /></a><a href="https://github.com/schmitch"><img src="https://github.com/schmitch.png" width="60px" alt="Schmitt Christian" /></a><a href="https://github.com/SebastianStehle"><img src="https://github.com/SebastianStehle.png" width="60px" alt="Sebastian Stehle" /></a><a href="https://github.com/communicatie-cockpit"><img src="https://github.com/communicatie-cockpit.png" width="60px" alt="Communicatie Cockpit" /></a><a href="https://github.com/KeithT"><img src="https://github.com/KeithT.png" width="60px" alt="" /></a><a href="https://github.com/Skrypt"><img src="https://github.com/Skrypt.png" width="60px" alt="Jasmin Savard" /></a><a href="https://github.com/ThomasBjallas"><img src="https://github.com/ThomasBjallas.png" width="60px" alt="Thomas" /></a><a href="https://github.com/jonmartinsson"><img src="https://github.com/jonmartinsson.png" width="60px" alt="" /></a><a href="https://github.com/EYERIDE-Fleet-Management-System"><img src="https://github.com/EYERIDE-Fleet-Management-System.png" width="60px" alt="EYERIDE Fleet Management System" /></a><a href="https://github.com/ravindUwU"><img src="https://github.com/ravindUwU.png" width="60px" alt="Ravindu Liyanapathirana" /></a><a href="https://github.com/dlandi"><img src="https://github.com/dlandi.png" width="60px" alt="HieronymusBlaze" /></a><a href="https://github.com/ahanoff"><img src="https://github.com/ahanoff.png" width="60px" alt="Akhan Zhakiyanov" /></a><a href="https://github.com/corentinbst"><img src="https://github.com/corentinbst.png" width="60px" alt="Corentin Brossutti" /></a><a href="https://github.com/blowdart"><img src="https://github.com/blowdart.png" width="60px" alt="Barry Dorrans" /></a><a href="https://github.com/devqsrl"><img src="https://github.com/devqsrl.png" width="60px" alt="DevQ S.r.l." /></a><a href="https://github.com/dgxhubbard"><img src="https://github.com/dgxhubbard.png" width="60px" alt="" /></a><a href="https://github.com/verdie-g"><img src="https://github.com/verdie-g.png" width="60px" alt="Grégoire" /></a><a href="https://github.com/forterro"><img src="https://github.com/forterro.png" width="60px" alt="Forterro" /></a><a href="https://github.com/MarcelMalik"><img src="https://github.com/MarcelMalik.png" width="60px" alt="Marcel" /></a><a href="https://github.com/jwillmer"><img src="https://github.com/jwillmer.png" width="60px" alt="Jens Willmer" /></a><a href="https://github.com/craaash80"><img src="https://github.com/craaash80.png" width="60px" alt="" /></a><a href="https://github.com/BlauhausTechnology"><img src="https://github.com/BlauhausTechnology.png" width="60px" alt="Blauhaus Technology (Pty) Ltd" /></a><a href="https://github.com/trejjam"><img src="https://github.com/trejjam.png" width="60px" alt="Jan Trejbal" /></a><a href="https://github.com/aviationexam"><img src="https://github.com/aviationexam.png" width="60px" alt="Aviationexam s.r.o." /></a><a href="https://github.com/ratiodata-se"><img src="https://github.com/ratiodata-se.png" width="60px" alt="Ratiodata SE" /></a><a href="https://github.com/jeroenbai"><img src="https://github.com/jeroenbai.png" width="60px" alt="Jeroen Baidenmann" /></a><a href="https://github.com/Lombiq"><img src="https://github.com/Lombiq.png" width="60px" alt="Lombiq Technologies Ltd." /></a><a href="https://github.com/andrewbabbittdev"><img src="https://github.com/andrewbabbittdev.png" width="60px" alt="Andrew Babbitt" /></a><a href="https://github.com/softawaregmbh"><img src="https://github.com/softawaregmbh.png" width="60px" alt="softaware gmbh" /></a><a href="https://github.com/SingularSystems"><img src="https://github.com/SingularSystems.png" width="60px" alt="Singular Systems" /></a><a href="https://github.com/SCP-srl"><img src="https://github.com/SCP-srl.png" width="60px" alt="SCP-srl" /></a><a href="https://github.com/realisable"><img src="https://github.com/realisable.png" width="60px" alt="Realisable Software" /></a><a href="https://github.com/sfmskywalker"><img src="https://github.com/sfmskywalker.png" width="60px" alt="Sipke Schoorstra" /></a><a href="https://github.com/dzmitry-lahoda"><img src="https://github.com/dzmitry-lahoda.png" width="60px" alt="dzmitry-lahoda" /></a><a href="https://github.com/JamesHough"><img src="https://github.com/JamesHough.png" width="60px" alt="James Hough" /></a><a href="https://github.com/kaputsyn"><img src="https://github.com/kaputsyn.png" width="60px" alt="" /></a><a href="https://github.com/jberzy"><img src="https://github.com/jberzy.png" width="60px" alt="" /></a><!-- sponsors -->
<!-- sponsors --><a href="https://github.com/sebastienros"><img src="https://github.com/sebastienros.png" width="60px" alt="Sébastien Ros" /></a><a href="https://github.com/schmitch"><img src="https://github.com/schmitch.png" width="60px" alt="Schmitt Christian" /></a><a href="https://github.com/SebastianStehle"><img src="https://github.com/SebastianStehle.png" width="60px" alt="Sebastian Stehle" /></a><a href="https://github.com/communicatie-cockpit"><img src="https://github.com/communicatie-cockpit.png" width="60px" alt="Communicatie Cockpit" /></a><a href="https://github.com/KeithT"><img src="https://github.com/KeithT.png" width="60px" alt="" /></a><a href="https://github.com/Skrypt"><img src="https://github.com/Skrypt.png" width="60px" alt="Jasmin Savard" /></a><a href="https://github.com/ThomasBjallas"><img src="https://github.com/ThomasBjallas.png" width="60px" alt="Thomas" /></a><a href="https://github.com/jonmartinsson"><img src="https://github.com/jonmartinsson.png" width="60px" alt="" /></a><a href="https://github.com/EYERIDE-Fleet-Management-System"><img src="https://github.com/EYERIDE-Fleet-Management-System.png" width="60px" alt="EYERIDE Fleet Management System" /></a><a href="https://github.com/ravindUwU"><img src="https://github.com/ravindUwU.png" width="60px" alt="Ravindu Liyanapathirana" /></a><a href="https://github.com/ahanoff"><img src="https://github.com/ahanoff.png" width="60px" alt="Akhan Zhakiyanov" /></a><a href="https://github.com/corentinbst"><img src="https://github.com/corentinbst.png" width="60px" alt="Corentin Brossutti" /></a><a href="https://github.com/blowdart"><img src="https://github.com/blowdart.png" width="60px" alt="Barry Dorrans" /></a><a href="https://github.com/devqsrl"><img src="https://github.com/devqsrl.png" width="60px" alt="DevQ S.r.l." /></a><a href="https://github.com/dgxhubbard"><img src="https://github.com/dgxhubbard.png" width="60px" alt="" /></a><a href="https://github.com/verdie-g"><img src="https://github.com/verdie-g.png" width="60px" alt="Grégoire" /></a><a href="https://github.com/forterro"><img src="https://github.com/forterro.png" width="60px" alt="Forterro" /></a><a href="https://github.com/MarcelMalik"><img src="https://github.com/MarcelMalik.png" width="60px" alt="Marcel" /></a><a href="https://github.com/jwillmer"><img src="https://github.com/jwillmer.png" width="60px" alt="Jens Willmer" /></a><a href="https://github.com/craaash80"><img src="https://github.com/craaash80.png" width="60px" alt="" /></a><a href="https://github.com/BlauhausTechnology"><img src="https://github.com/BlauhausTechnology.png" width="60px" alt="Blauhaus Technology (Pty) Ltd" /></a><a href="https://github.com/trejjam"><img src="https://github.com/trejjam.png" width="60px" alt="Jan Trejbal" /></a><a href="https://github.com/aviationexam"><img src="https://github.com/aviationexam.png" width="60px" alt="Aviationexam s.r.o." /></a><a href="https://github.com/ratiodata-se"><img src="https://github.com/ratiodata-se.png" width="60px" alt="Ratiodata SE" /></a><a href="https://github.com/jeroenbai"><img src="https://github.com/jeroenbai.png" width="60px" alt="Jeroen Baidenmann" /></a><a href="https://github.com/Lombiq"><img src="https://github.com/Lombiq.png" width="60px" alt="Lombiq Technologies Ltd." /></a><a href="https://github.com/andrewbabbittdev"><img src="https://github.com/andrewbabbittdev.png" width="60px" alt="Andrew Babbitt" /></a><a href="https://github.com/softawaregmbh"><img src="https://github.com/softawaregmbh.png" width="60px" alt="softaware gmbh" /></a><a href="https://github.com/SingularSystems"><img src="https://github.com/SingularSystems.png" width="60px" alt="Singular Systems" /></a><a href="https://github.com/SCP-srl"><img src="https://github.com/SCP-srl.png" width="60px" alt="SCP-srl" /></a><a href="https://github.com/realisable"><img src="https://github.com/realisable.png" width="60px" alt="Realisable Software" /></a><a href="https://github.com/sfmskywalker"><img src="https://github.com/sfmskywalker.png" width="60px" alt="Sipke Schoorstra" /></a><a href="https://github.com/JamesHough"><img src="https://github.com/JamesHough.png" width="60px" alt="James Hough" /></a><a href="https://github.com/kaputsyn"><img src="https://github.com/kaputsyn.png" width="60px" alt="" /></a><a href="https://github.com/jberzy"><img src="https://github.com/jberzy.png" width="60px" alt="" /></a><!-- sponsors -->
--------------

35
gen/OpenIddict.Client.WebIntegration.Generators/OpenIddictClientWebIntegrationGenerator.cs

@ -79,10 +79,7 @@ public sealed partial class OpenIddictClientWebIntegrationBuilder
{{~ end ~}}
public OpenIddictClientWebIntegrationBuilder Add{{ provider.name }}(Action<OpenIddictClientWebIntegrationBuilder.{{ provider.name }}> configuration)
{
if (configuration is null)
{
throw new ArgumentNullException(nameof(configuration));
}
ArgumentNullException.ThrowIfNull(configuration);
Services.Configure<OpenIddictClientOptions>(options =>
{
@ -132,10 +129,7 @@ public sealed partial class OpenIddictClientWebIntegrationBuilder
[EditorBrowsable(EditorBrowsableState.Advanced)]
public {{ provider.name }} AddClientAuthenticationMethods(params string[] methods)
{
if (methods is null)
{
throw new ArgumentNullException(nameof(methods));
}
ArgumentNullException.ThrowIfNull(methods);
return Set(registration => registration.ClientAuthenticationMethods.UnionWith(methods));
}
@ -149,10 +143,7 @@ public sealed partial class OpenIddictClientWebIntegrationBuilder
[EditorBrowsable(EditorBrowsableState.Advanced)]
public {{ provider.name }} AddCodeChallengeMethods(params string[] methods)
{
if (methods is null)
{
throw new ArgumentNullException(nameof(methods));
}
ArgumentNullException.ThrowIfNull(methods);
return Set(registration => registration.CodeChallengeMethods.UnionWith(methods));
}
@ -166,10 +157,7 @@ public sealed partial class OpenIddictClientWebIntegrationBuilder
[EditorBrowsable(EditorBrowsableState.Advanced)]
public {{ provider.name }} AddGrantTypes(params string[] types)
{
if (types is null)
{
throw new ArgumentNullException(nameof(types));
}
ArgumentNullException.ThrowIfNull(types);
return Set(registration => registration.GrantTypes.UnionWith(types));
}
@ -183,10 +171,7 @@ public sealed partial class OpenIddictClientWebIntegrationBuilder
[EditorBrowsable(EditorBrowsableState.Advanced)]
public {{ provider.name }} AddResponseModes(params string[] modes)
{
if (modes is null)
{
throw new ArgumentNullException(nameof(modes));
}
ArgumentNullException.ThrowIfNull(modes);
return Set(registration => registration.ResponseModes.UnionWith(modes));
}
@ -200,10 +185,7 @@ public sealed partial class OpenIddictClientWebIntegrationBuilder
[EditorBrowsable(EditorBrowsableState.Advanced)]
public {{ provider.name }} AddResponseTypes(params string[] types)
{
if (types is null)
{
throw new ArgumentNullException(nameof(types));
}
ArgumentNullException.ThrowIfNull(types);
return Set(registration => registration.ResponseTypes.UnionWith(types));
}
@ -215,10 +197,7 @@ public sealed partial class OpenIddictClientWebIntegrationBuilder
/// <returns>The <see cref=""OpenIddictClientWebIntegrationBuilder.{{ provider.name }}""/> instance.</returns>
public {{ provider.name }} AddScopes(params string[] scopes)
{
if (scopes is null)
{
throw new ArgumentNullException(nameof(scopes));
}
ArgumentNullException.ThrowIfNull(scopes);
return Set(registration => registration.Scopes.UnionWith(scopes));
}

66
shared/OpenIddict.Extensions/OpenIddictHelpers.cs

@ -656,7 +656,7 @@ internal static class OpenIddictHelpers
/// </exception>
public static byte[] CreateRandomArray(int size)
{
using var algorithm = GetAlgorithmFromConfig() switch
var algorithm = GetAlgorithmFromConfig() switch
{
RandomNumberGenerator result => result,
null => null,
@ -665,13 +665,35 @@ internal static class OpenIddictHelpers
// If no custom random number generator was registered, use either the static GetBytes() or
// Fill() APIs on platforms that support them or create a default instance provided by the BCL.
#if SUPPORTS_ONE_SHOT_RANDOM_NUMBER_GENERATOR_METHODS
if (algorithm is null)
{
return RandomNumberGenerator.GetBytes(size / 8);
}
var array = new byte[size / 8];
algorithm.GetBytes(array);
return array;
}
#endif
var array = new byte[size / 8];
algorithm.GetBytes(array);
#if SUPPORTS_STATIC_RANDOM_NUMBER_GENERATOR_METHODS
if (algorithm is null)
{
RandomNumberGenerator.Fill(array);
return array;
}
#else
algorithm ??= RandomNumberGenerator.Create();
#endif
try
{
algorithm.GetBytes(array);
}
finally
{
algorithm.Dispose();
}
return array;
@ -692,30 +714,40 @@ internal static class OpenIddictHelpers
/// </exception>
public static string CreateRandomString(ReadOnlySpan<string> charset, int count)
{
using var algorithm = GetAlgorithmFromConfig() switch
var algorithm = GetAlgorithmFromConfig() switch
{
RandomNumberGenerator result => result,
null => null,
var result => throw new CryptographicException(SR.FormatID0351(result.GetType().FullName))
};
var builder = new StringBuilder();
for (var index = 0; index < count; index++)
try
{
// Pick a character in the specified charset by generating a random index.
builder.Append(charset[index: algorithm switch
var builder = new StringBuilder();
for (var index = 0; index < count; index++)
{
// If no custom random number generator was registered, use the static GetInt32() API.
null => RandomNumberGenerator.GetInt32(0, charset.Length),
// Pick a character in the specified charset by generating a random index.
builder.Append(charset[index: algorithm switch
{
#if SUPPORTS_INT32_RANDOM_NUMBER_GENERATOR_METHODS
// If no custom random number generator was registered, use
// the static GetInt32() API on platforms that support it.
null => RandomNumberGenerator.GetInt32(0, charset.Length),
#endif
// Otherwise, create a default implementation if necessary
// and use the local function that achieves the same result.
_ => GetInt32(algorithm ??= RandomNumberGenerator.Create(), 0..charset.Length)
}]);
}
// Otherwise, create a default implementation if necessary
// and use the local function that achieves the same result.
_ => GetInt32(algorithm, 0..charset.Length)
}]);
return builder.ToString();
}
return builder.ToString();
finally
{
algorithm?.Dispose();
}
static int GetInt32(RandomNumberGenerator algorithm, Range range)
{

306
shared/OpenIddict.Extensions/OpenIddictPolyfills.cs

@ -0,0 +1,306 @@
/*
* Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
* See https://github.com/openiddict/openiddict-core for more information concerning
* the license and the contributors participating to this project.
*/
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
namespace OpenIddict.Extensions;
/// <summary>
/// Exposes common polyfills used by the OpenIddict assemblies.
/// </summary>
internal static class OpenIddictPolyfills
{
extension(ArgumentOutOfRangeException)
{
/// <summary>Throws an <see cref="ArgumentOutOfRangeException"/> if <paramref name="value"/> is negative.</summary>
/// <param name="value">The argument to validate as non-negative.</param>
/// <param name="paramName">The name of the parameter with which <paramref name="value"/> corresponds.</param>
public static void ThrowIfNegative<T>(T value, [CallerArgumentExpression(nameof(value))] string? paramName = null)
where T : struct, IComparable<T>
{
switch (value)
{
case byte or ushort or uint or ulong or char:
return;
case sbyte n:
if (n < 0)
ThrowArgumentOutOfRangeException(paramName, value);
return;
case short n:
if (n < 0)
ThrowArgumentOutOfRangeException(paramName, value);
return;
case int n:
if (n < 0)
ThrowArgumentOutOfRangeException(paramName, value);
return;
case long n:
if (n < 0L)
ThrowArgumentOutOfRangeException(paramName, value);
return;
case float n:
if (n < 0F)
ThrowArgumentOutOfRangeException(paramName, value);
return;
case double n:
if (n < 0D)
ThrowArgumentOutOfRangeException(paramName, value);
return;
case decimal n:
if (n < 0M)
ThrowArgumentOutOfRangeException(paramName, value);
return;
default:
throw new InvalidOperationException($"Invalid type '{typeof(T).AssemblyQualifiedName}' for {paramName}.");
}
static void ThrowArgumentOutOfRangeException(string? paramName, object value)
{
throw new ArgumentOutOfRangeException(paramName, value, $"{paramName} ('{value}') must not be negative.");
}
}
}
extension(Convert)
{
#if !SUPPORTS_HEXADECIMAL_STRING_CONVERSION
/// <summary>Converts the specified string, which encodes binary data as hex characters, to an equivalent 8-bit unsigned integer array.</summary>
/// <param name="s">The string to convert.</param>
/// <returns>An array of 8-bit unsigned integers that is equivalent to <paramref name="s"/>.</returns>
/// <exception cref="ArgumentNullException"><paramref name="s"/> is <code>null</code>.</exception>
/// <exception cref="FormatException">The length of <paramref name="s"/>, is not zero or a multiple of 2.</exception>
/// <exception cref="FormatException">The format of <paramref name="s"/> is invalid. <paramref name="s"/> contains a non-hex character.</exception>
public static byte[] FromHexString(string s)
{
if ((uint) s.Length % 2 is not 0)
{
throw new FormatException(SR.GetResourceString(SR.ID0413));
}
var array = new byte[s.Length / 2];
for (var index = 0; index < s.Length; index += 2)
{
array[index / 2] = Convert.ToByte(s.Substring(index, 2), 16);
}
return array;
}
#endif
}
extension<TSource>(IEnumerable<TSource> source)
{
#if !SUPPORTS_CHUNK_LINQ_EXTENSION
/// <summary>
/// Split the elements of a sequence into chunks of size at most <paramref name="size"/>.
/// </summary>
/// <remarks>
/// Every chunk except the last will be of size <paramref name="size"/>.
/// The last chunk will contain the remaining elements and may be of a smaller size.
/// </remarks>
/// <param name="size">Maximum size of each chunk.</param>
/// <returns>
/// An <see cref="IEnumerable{T}"/> that contains the elements of the input
/// sequence split into chunks of size <paramref name="size"/>.
/// </returns>
public IEnumerable<TSource[]> Chunk(int size)
{
// Note: this polyfill was directly copied from .NET's source code:
// https://github.com/dotnet/runtime/blob/main/src/libraries/System.Linq/src/System/Linq/Chunk.cs.
using IEnumerator<TSource> enumerator = source.GetEnumerator();
if (enumerator.MoveNext())
{
var count = Math.Min(size, 4);
int index;
do
{
var array = new TSource[count];
array[0] = enumerator.Current;
index = 1;
if (size != array.Length)
{
for (; index < size && enumerator.MoveNext(); index++)
{
if (index >= array.Length)
{
count = (int) Math.Min((uint) size, 2 * (uint) array.Length);
Array.Resize(ref array, count);
}
array[index] = enumerator.Current;
}
}
else
{
var local = array;
Debug.Assert(local.Length == size);
for (; (uint) index < (uint) local.Length && enumerator.MoveNext(); index++)
{
local[index] = enumerator.Current;
}
}
if (index != array.Length)
{
Array.Resize(ref array, index);
}
yield return array;
}
while (index >= size && enumerator.MoveNext());
}
}
#endif
}
extension(OperatingSystem)
{
#if !SUPPORTS_OPERATING_SYSTEM_VERSIONS_COMPARISON
/// <summary>
/// Indicates whether the current application is running on Android.
/// </summary>
public static bool IsAndroid() => RuntimeInformation.IsOSPlatform(OSPlatform.Create("ANDROID"));
/// <summary>
/// Check for the Android API level (returned by 'ro.build.version.sdk') with a >=
/// version comparison. Used to guard APIs that were added in the given Android release.
/// </summary>
public static bool IsAndroidVersionAtLeast(int major, int minor = 0, int build = 0, int revision = 0)
=> IsAndroid() && IsOSVersionAtLeast(major, minor, build, revision);
/// <summary>
/// Indicates whether the current application is running on iOS or MacCatalyst.
/// </summary>
[SupportedOSPlatformGuard("maccatalyst")]
public static bool IsIOS() => RuntimeInformation.IsOSPlatform(OSPlatform.Create("IOS"));
/// <summary>
/// Check for the iOS/MacCatalyst version (returned by 'libobjc.get_operatingSystemVersion')
/// with a >= version comparison. Used to guard APIs that were added in the given iOS release.
/// </summary>
[SupportedOSPlatformGuard("maccatalyst")]
public static bool IsIOSVersionAtLeast(int major, int minor = 0, int build = 0)
=> IsIOS() && IsOSVersionAtLeast(major, minor, build, 0);
/// <summary>
/// Indicates whether the current application is running on Linux.
/// </summary>
public static bool IsLinux() => RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
/// <summary>
/// Indicates whether the current application is running on Mac Catalyst.
/// </summary>
public static bool IsMacCatalyst() => RuntimeInformation.IsOSPlatform(OSPlatform.Create("MACCATALYST"));
/// <summary>
/// Check for the Mac Catalyst version (iOS version as presented in Apple documentation) with a >=
/// version comparison. Used to guard APIs that were added in the given Mac Catalyst release.
/// </summary>
public static bool IsMacCatalystVersionAtLeast(int major, int minor = 0, int build = 0)
=> IsMacCatalyst() && IsOSVersionAtLeast(major, minor, build, 0);
/// <summary>
/// Indicates whether the current application is running on macOS.
/// </summary>
public static bool IsMacOS() => RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
/// <summary>
/// Check for the macOS version (returned by 'libobjc.get_operatingSystemVersion') with a >=
/// version comparison. Used to guard APIs that were added in the given macOS release.
/// </summary>
public static bool IsMacOSVersionAtLeast(int major, int minor = 0, int build = 0)
=> IsMacOS() && IsOSVersionAtLeast(major, minor, build, 0);
/// <summary>
/// Indicates whether the current application is running on Windows.
/// </summary>
public static bool IsWindows() => RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
/// <summary>
/// Check for the Windows version (returned by 'RtlGetVersion') with a >= version
/// comparison. Used to guard APIs that were added in the given Windows release.
/// </summary>
public static bool IsWindowsVersionAtLeast(int major, int minor = 0, int build = 0, int revision = 0)
{
if (Environment.OSVersion.Platform is PlatformID.Win32NT &&
Environment.OSVersion.Version >= new Version(major, minor, build, revision))
{
return true;
}
// Note: on older versions of .NET, Environment.OSVersion.Version is known to be affected by
// the compatibility shims used by Windows 10+ when the application doesn't have a manifest
// that explicitly indicates it's compatible with Windows 10 and higher. To avoid that, a
// second pass using RuntimeInformation.OSDescription (that calls NtDll.RtlGetVersion() under
// the hood) is made. Note: no version is returned on UWP due to the missing Win32 API.
return RuntimeInformation.OSDescription.StartsWith("Microsoft Windows ", StringComparison.OrdinalIgnoreCase) &&
RuntimeInformation.OSDescription["Microsoft Windows ".Length..] is string value &&
Version.TryParse(value, out Version? version) && version >= new Version(major, minor, build, revision);
}
#endif
}
extension(ValueTask)
{
#if !SUPPORTS_VALUETASK_COMPLETED_TASK
/// <summary>
/// Gets a task that has already completed successfully.
/// </summary>
public static ValueTask CompletedTask => default;
#endif
}
extension<TResult>(ValueTask<TResult>)
{
#if !SUPPORTS_VALUETASK_COMPLETED_TASK
/// <summary>
/// Gets a task that has already completed successfully.
/// </summary>
public static ValueTask<TResult> CompletedTask => default;
#endif
}
#if !SUPPORTS_OPERATING_SYSTEM_VERSIONS_COMPARISON
static bool IsOSVersionAtLeast(int major, int minor, int build, int revision)
{
Version current = Environment.OSVersion.Version;
if (current.Major != major)
{
return current.Major > major;
}
if (current.Minor != minor)
{
return current.Minor > minor;
}
int currentBuild = current.Build < 0 ? 0 : current.Build;
build = build < 0 ? 0 : build;
if (currentBuild != build)
{
return currentBuild > build;
}
int currentRevision = current.Revision < 0 ? 0 : current.Revision;
revision = revision < 0 ? 0 : revision;
return currentRevision >= revision;
}
#endif
}

5
src/OpenIddict.Abstractions/OpenIddict.Abstractions.csproj

@ -38,6 +38,11 @@
<PackageReference Include="System.ComponentModel.Annotations" />
</ItemGroup>
<ItemGroup
Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' And $([MSBuild]::VersionLessThan($(TargetFrameworkVersion), '4.7.1')) ">
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="**\*.resx" GenerateSource="true" GenerateResourcesCodeAsConstants="true" />
</ItemGroup>

10
src/OpenIddict.Client.Owin/OpenIddictClientOwinBuilder.cs

@ -38,10 +38,7 @@ public sealed class OpenIddictClientOwinBuilder
/// <returns>The <see cref="OpenIddictClientOwinBuilder"/> instance.</returns>
public OpenIddictClientOwinBuilder Configure(Action<OpenIddictClientOwinOptions> configuration)
{
if (configuration is null)
{
throw new ArgumentNullException(nameof(configuration));
}
ArgumentNullException.ThrowIfNull(configuration);
Services.Configure(configuration);
@ -137,10 +134,7 @@ public sealed class OpenIddictClientOwinBuilder
/// <returns>The <see cref="OpenIddictClientOwinBuilder"/> instance.</returns>
public OpenIddictClientOwinBuilder SetCookieManager(ICookieManager manager)
{
if (manager is null)
{
throw new ArgumentNullException(nameof(manager));
}
ArgumentNullException.ThrowIfNull(manager);
return Configure(options => options.CookieManager = manager);
}

10
src/OpenIddict.Client.Owin/OpenIddictClientOwinConfiguration.cs

@ -30,10 +30,7 @@ public sealed class OpenIddictClientOwinConfiguration : IConfigureOptions<OpenId
/// <inheritdoc/>
public void Configure(OpenIddictClientOptions options)
{
if (options is null)
{
throw new ArgumentNullException(nameof(options));
}
ArgumentNullException.ThrowIfNull(options);
// Register the built-in event handlers used by the OpenIddict OWIN Client components.
options.Handlers.AddRange(OpenIddictClientOwinHandlers.DefaultHandlers);
@ -42,10 +39,7 @@ public sealed class OpenIddictClientOwinConfiguration : IConfigureOptions<OpenId
/// <inheritdoc/>
public void PostConfigure(string? name, OpenIddictClientOwinOptions options)
{
if (options is null)
{
throw new ArgumentNullException(nameof(options));
}
ArgumentNullException.ThrowIfNull(options);
// If no cookie manager was explicitly configured but the OWIN application builder was registered as a service
// (which is required when using Autofac with the built-in Katana authentication middleware, as they require

16
src/OpenIddict.Client.Owin/OpenIddictClientOwinExtensions.cs

@ -24,10 +24,7 @@ public static class OpenIddictClientOwinExtensions
/// <returns>The <see cref="OpenIddictClientOwinBuilder"/> instance.</returns>
public static OpenIddictClientOwinBuilder UseOwin(this OpenIddictClientBuilder builder)
{
if (builder is null)
{
throw new ArgumentNullException(nameof(builder));
}
ArgumentNullException.ThrowIfNull(builder);
builder.Services.AddWebEncoders();
@ -68,15 +65,8 @@ public static class OpenIddictClientOwinExtensions
public static OpenIddictClientBuilder UseOwin(
this OpenIddictClientBuilder builder, Action<OpenIddictClientOwinBuilder> configuration)
{
if (builder is null)
{
throw new ArgumentNullException(nameof(builder));
}
if (configuration is null)
{
throw new ArgumentNullException(nameof(configuration));
}
ArgumentNullException.ThrowIfNull(builder);
ArgumentNullException.ThrowIfNull(configuration);
configuration(builder.UseOwin());

25
src/OpenIddict.Client.Owin/OpenIddictClientOwinHandlerFilters.cs

@ -30,10 +30,7 @@ public static class OpenIddictClientOwinHandlerFilters
/// <inheritdoc/>
public ValueTask<bool> IsActiveAsync(BaseContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
return new(_options.CurrentValue.EnablePostLogoutRedirectionEndpointPassthrough);
}
@ -53,10 +50,7 @@ public static class OpenIddictClientOwinHandlerFilters
/// <inheritdoc/>
public ValueTask<bool> IsActiveAsync(BaseContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
return new(_options.CurrentValue.EnableRedirectionEndpointPassthrough);
}
@ -75,10 +69,7 @@ public static class OpenIddictClientOwinHandlerFilters
/// <inheritdoc/>
public ValueTask<bool> IsActiveAsync(BaseContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
return new(_options.CurrentValue.EnableErrorPassthrough);
}
@ -92,10 +83,7 @@ public static class OpenIddictClientOwinHandlerFilters
/// <inheritdoc/>
public ValueTask<bool> IsActiveAsync(BaseContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
return new(context.Transaction.GetOwinRequest() is not null);
}
@ -114,10 +102,7 @@ public static class OpenIddictClientOwinHandlerFilters
/// <inheritdoc/>
public ValueTask<bool> IsActiveAsync(BaseContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
return new(!_options.CurrentValue.DisableTransportSecurityRequirement);
}

6
src/OpenIddict.Client.Owin/OpenIddictClientOwinHandlers.Authentication.cs

@ -5,6 +5,7 @@
*/
using System.Collections.Immutable;
using Microsoft.Extensions.Options;
using Owin;
namespace OpenIddict.Client.Owin;
@ -61,10 +62,7 @@ public static partial class OpenIddictClientOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ApplyAuthorizationRequestContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If the HTTP context cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.

5
src/OpenIddict.Client.Owin/OpenIddictClientOwinHandlers.Session.cs

@ -59,10 +59,7 @@ public static partial class OpenIddictClientOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ApplyEndSessionRequestContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If the HTTP context cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.

115
src/OpenIddict.Client.Owin/OpenIddictClientOwinHandlers.cs

@ -92,10 +92,7 @@ public static partial class OpenIddictClientOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ProcessRequestContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -146,10 +143,7 @@ public static partial class OpenIddictClientOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ProcessRequestContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -196,10 +190,7 @@ public static partial class OpenIddictClientOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ProcessRequestContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -242,10 +233,7 @@ public static partial class OpenIddictClientOwinHandlers
/// <inheritdoc/>
public async ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -328,10 +316,7 @@ public static partial class OpenIddictClientOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ProcessAuthenticationContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
if (context.GrantType is GrantTypes.DeviceCode)
{
@ -362,10 +347,7 @@ public static partial class OpenIddictClientOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ProcessAuthenticationContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
if (!string.IsNullOrEmpty(context.Nonce))
{
@ -403,10 +385,7 @@ public static partial class OpenIddictClientOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ProcessAuthenticationContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
Debug.Assert(context.StateTokenPrincipal is { Identity: ClaimsIdentity }, SR.GetResourceString(SR.ID4006));
@ -529,10 +508,7 @@ public static partial class OpenIddictClientOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ProcessChallengeContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
if (context.GrantType is GrantTypes.DeviceCode)
{
@ -564,10 +540,7 @@ public static partial class OpenIddictClientOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ProcessChallengeContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If the HTTP context cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -687,10 +660,7 @@ public static partial class OpenIddictClientOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ProcessChallengeContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -726,10 +696,7 @@ public static partial class OpenIddictClientOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ProcessChallengeContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// If an explicit response type was specified, don't overwrite it.
if (!string.IsNullOrEmpty(context.ResponseMode))
@ -826,10 +793,7 @@ public static partial class OpenIddictClientOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ProcessChallengeContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// Note: using a correlation cookie serves as an injection/antiforgery protection as the request
// will always be rejected if a cookie corresponding to the request forgery protection claim
@ -920,10 +884,7 @@ public static partial class OpenIddictClientOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ProcessSignOutContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If the HTTP context cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -1033,10 +994,7 @@ public static partial class OpenIddictClientOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ProcessSignOutContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -1079,10 +1037,7 @@ public static partial class OpenIddictClientOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ProcessSignOutContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// Note: using a correlation cookie serves as an injection/antiforgery protection as the request
// will always be rejected if a cookie corresponding to the request forgery protection claim
@ -1175,10 +1130,7 @@ public static partial class OpenIddictClientOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
context.SkipRequest();
@ -1206,10 +1158,7 @@ public static partial class OpenIddictClientOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If the HTTP context cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -1249,10 +1198,7 @@ public static partial class OpenIddictClientOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -1302,10 +1248,7 @@ public static partial class OpenIddictClientOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -1369,10 +1312,7 @@ public static partial class OpenIddictClientOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If the HTTP context cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -1413,10 +1353,7 @@ public static partial class OpenIddictClientOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
Debug.Assert(context.Transaction.Response is not null, SR.GetResourceString(SR.ID4007));
@ -1452,10 +1389,7 @@ public static partial class OpenIddictClientOwinHandlers
/// <inheritdoc/>
public async ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If the HTTP context cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -1526,10 +1460,7 @@ public static partial class OpenIddictClientOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
context.Logger.LogInformation(6145, SR.GetResourceString(SR.ID6145));
context.HandleRequest();

26
src/OpenIddict.Client.Owin/OpenIddictClientOwinHelpers.cs

@ -4,6 +4,7 @@
* the license and the contributors participating to this project.
*/
using Microsoft.Extensions.Options;
using OpenIddict.Client;
using OpenIddict.Client.Owin;
@ -23,10 +24,7 @@ public static class OpenIddictClientOwinHelpers
/// <returns>The <see cref="IAppBuilder"/> instance.</returns>
public static IAppBuilder UseOpenIddictClient(this IAppBuilder app)
{
if (app is null)
{
throw new ArgumentNullException(nameof(app));
}
ArgumentNullException.ThrowIfNull(app);
return app.Use<OpenIddictClientOwinMiddlewareFactory>();
}
@ -38,10 +36,7 @@ public static class OpenIddictClientOwinHelpers
/// <returns>The <see cref="IOwinRequest"/> instance or <see langword="null"/> if it couldn't be found.</returns>
public static IOwinRequest? GetOwinRequest(this OpenIddictClientTransaction transaction)
{
if (transaction is null)
{
throw new ArgumentNullException(nameof(transaction));
}
ArgumentNullException.ThrowIfNull(transaction);
if (!transaction.Properties.TryGetValue(typeof(IOwinRequest).FullName!, out object? property))
{
@ -63,10 +58,7 @@ public static class OpenIddictClientOwinHelpers
/// <returns>The <see cref="OpenIddictClientEndpointType"/>.</returns>
public static OpenIddictClientEndpointType GetOpenIddictClientEndpointType(this IOwinContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
return context.Get<OpenIddictClientTransaction>(typeof(OpenIddictClientTransaction).FullName)?.EndpointType ?? default;
}
@ -78,10 +70,7 @@ public static class OpenIddictClientOwinHelpers
/// <returns>The <see cref="OpenIddictRequest"/> instance or <see langword="null"/> if it couldn't be found.</returns>
public static OpenIddictRequest? GetOpenIddictClientRequest(this IOwinContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
return context.Get<OpenIddictClientTransaction>(typeof(OpenIddictClientTransaction).FullName)?.Request;
}
@ -93,10 +82,7 @@ public static class OpenIddictClientOwinHelpers
/// <returns>The <see cref="OpenIddictResponse"/> instance or <see langword="null"/> if it couldn't be found.</returns>
public static OpenIddictResponse? GetOpenIddictClientResponse(this IOwinContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
return context.Get<OpenIddictClientTransaction>(typeof(OpenIddictClientTransaction).FullName)?.Response;
}

2
src/OpenIddict.Client.Owin/OpenIddictClientOwinMiddleware.cs

@ -58,6 +58,8 @@ public sealed class OpenIddictClientOwinMiddleware : AuthenticationMiddleware<Op
/// <inheritdoc/>
public override async Task Invoke(IOwinContext context)
{
ArgumentNullException.ThrowIfNull(context);
// Retrieve the existing authentication delegate.
var function = context.Get<AuthenticateDelegate?>("security.Authenticate");

5
src/OpenIddict.Client.Owin/OpenIddictClientOwinMiddlewareFactory.cs

@ -37,10 +37,7 @@ public sealed class OpenIddictClientOwinMiddlewareFactory : OwinMiddleware
/// </returns>
public override Task Invoke(IOwinContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
var provider = context.Get<IServiceProvider>(typeof(IServiceProvider).FullName) ??
throw new InvalidOperationException(SR.GetResourceString(SR.ID0316));

2
src/OpenIddict.Client.SystemIntegration/OpenIddict.Client.SystemIntegration.csproj

@ -30,7 +30,7 @@
allow loading dependencies that are not strong-named), the warning can be safely disabled.
-->
<NoWarn>$(NoWarn);CS8002</NoWarn>
<DefineConstants>$(DefineConstants);FeatureRuntimeInformation;FeatureValueTuple</DefineConstants>
<DefineConstants>$(DefineConstants);FeatureValueTuple</DefineConstants>
</PropertyGroup>
<PropertyGroup>

9
src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationConfiguration.cs

@ -62,12 +62,9 @@ public sealed class OpenIddictClientSystemIntegrationConfiguration : IConfigureO
ArgumentNullException.ThrowIfNull(options);
// Ensure the operating system version is supported.
if ((OperatingSystem.IsAndroid() && !OperatingSystem.IsAndroidVersionAtLeast(21)) ||
(OperatingSystem.IsIOS() && !OperatingSystem.IsIOSVersionAtLeast(12)) ||
OperatingSystem.IsLinux() ||
(OperatingSystem.IsMacCatalyst() && !OperatingSystem.IsMacCatalystVersionAtLeast(13, 1)) ||
(OperatingSystem.IsMacOS() && !OperatingSystem.IsMacOSVersionAtLeast(10, 15)) ||
(OperatingSystem.IsWindows() && !OperatingSystem.IsWindowsVersionAtLeast(7)))
if (!OperatingSystem.IsAndroidVersionAtLeast(21) && !OperatingSystem.IsIOSVersionAtLeast(12) &&
!OperatingSystem.IsLinux() && !OperatingSystem.IsMacCatalystVersionAtLeast(13, 1) &&
!OperatingSystem.IsMacOSVersionAtLeast(10, 15) && !OperatingSystem.IsWindowsVersionAtLeast(7))
{
throw new PlatformNotSupportedException(SR.GetResourceString(SR.ID0389));
}

9
src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationExtensions.cs

@ -28,12 +28,9 @@ public static class OpenIddictClientSystemIntegrationExtensions
ArgumentNullException.ThrowIfNull(builder);
// Ensure the operating system version is supported.
if ((OperatingSystem.IsAndroid() && !OperatingSystem.IsAndroidVersionAtLeast(21)) ||
(OperatingSystem.IsIOS() && !OperatingSystem.IsIOSVersionAtLeast(12)) ||
OperatingSystem.IsLinux() ||
(OperatingSystem.IsMacCatalyst() && !OperatingSystem.IsMacCatalystVersionAtLeast(13, 1)) ||
(OperatingSystem.IsMacOS() && !OperatingSystem.IsMacOSVersionAtLeast(10, 15)) ||
(OperatingSystem.IsWindows() && !OperatingSystem.IsWindowsVersionAtLeast(7)))
if (!OperatingSystem.IsAndroidVersionAtLeast(21) && !OperatingSystem.IsIOSVersionAtLeast(12) &&
!OperatingSystem.IsLinux() && !OperatingSystem.IsMacCatalystVersionAtLeast(13, 1) &&
!OperatingSystem.IsMacOSVersionAtLeast(10, 15) && !OperatingSystem.IsWindowsVersionAtLeast(7))
{
throw new PlatformNotSupportedException(SR.GetResourceString(SR.ID0389));
}

4
src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHelpers.cs

@ -77,7 +77,7 @@ public static class OpenIddictClientSystemIntegrationHelpers
[SupportedOSPlatformGuard("maccatalyst13.1")]
[SupportedOSPlatformGuard("macos10.15")]
internal static bool IsASWebAuthenticationSessionSupported()
#if SUPPORTS_AUTHENTICATION_SERVICES && SUPPORTS_OPERATING_SYSTEM_VERSIONS_COMPARISON
#if SUPPORTS_AUTHENTICATION_SERVICES
=> OperatingSystem.IsIOSVersionAtLeast(12) ||
OperatingSystem.IsMacCatalystVersionAtLeast(13) ||
OperatingSystem.IsMacOSVersionAtLeast(10, 15);
@ -92,7 +92,7 @@ public static class OpenIddictClientSystemIntegrationHelpers
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[SupportedOSPlatformGuard("android21.0")]
internal static bool IsCustomTabsIntentSupported()
#if SUPPORTS_ANDROIDX_BROWSER && SUPPORTS_OPERATING_SYSTEM_VERSIONS_COMPARISON
#if SUPPORTS_ANDROIDX_BROWSER
=> OperatingSystem.IsAndroidVersionAtLeast(21);
#else
=> false;

1
src/OpenIddict.Client.SystemNetHttp/OpenIddict.Client.SystemNetHttp.csproj

@ -6,7 +6,6 @@
$(NetCoreTargetFrameworks);
$(NetStandardTargetFrameworks)
</TargetFrameworks>
<DefineConstants>$(DefineConstants);FeatureRuntimeInformation</DefineConstants>
</PropertyGroup>
<PropertyGroup>

2
src/OpenIddict.Client/OpenIddictClientHandlerDescriptor.cs

@ -142,7 +142,7 @@ public sealed class OpenIddictClientHandlerDescriptor
/// <returns>The builder instance, so that calls can be easily chained.</returns>
public Builder<TContext> SetType(OpenIddictClientHandlerType type)
{
if (!Enum.IsDefined(typeof(OpenIddictClientHandlerType), type))
if (!Enum.IsDefined(type))
{
throw new InvalidEnumArgumentException(nameof(type), (int) type, typeof(OpenIddictClientHandlerType));
}

2
src/OpenIddict.Client/OpenIddictClientModels.cs

@ -26,7 +26,7 @@ public static class OpenIddictClientModels
public CancellationToken CancellationToken { get; init; }
/// <summary>
/// Gets or sets the nonce that was returned during the challenge operation.
/// Gets or sets the nonce that was returned during the challenge or sign-out operation.
/// </summary>
public required string Nonce { get; init; }

2
src/OpenIddict.Core/Managers/OpenIddictScopeManager.cs

@ -849,7 +849,7 @@ public class OpenIddictScopeManager<TScope> : IOpenIddictScopeManager where TSco
yield return new ValidationResult(SR.GetResourceString(SR.ID2044));
}
else if (name!.Contains(Separators.Space[0]))
else if (name.Contains(Separators.Space[0]))
{
yield return new ValidationResult(SR.GetResourceString(SR.ID2045));
}

5
src/OpenIddict.Server.Owin/OpenIddictServerOwinBuilder.cs

@ -37,10 +37,7 @@ public sealed class OpenIddictServerOwinBuilder
/// <returns>The <see cref="OpenIddictServerOwinBuilder"/> instance.</returns>
public OpenIddictServerOwinBuilder Configure(Action<OpenIddictServerOwinOptions> configuration)
{
if (configuration is null)
{
throw new ArgumentNullException(nameof(configuration));
}
ArgumentNullException.ThrowIfNull(configuration);
Services.Configure(configuration);

10
src/OpenIddict.Server.Owin/OpenIddictServerOwinConfiguration.cs

@ -19,10 +19,7 @@ public sealed class OpenIddictServerOwinConfiguration : IConfigureOptions<OpenId
/// <inheritdoc/>
public void Configure(OpenIddictServerOptions options)
{
if (options is null)
{
throw new ArgumentNullException(nameof(options));
}
ArgumentNullException.ThrowIfNull(options);
// Register the built-in event handlers used by the OpenIddict OWIN server components.
options.Handlers.AddRange(OpenIddictServerOwinHandlers.DefaultHandlers);
@ -34,10 +31,7 @@ public sealed class OpenIddictServerOwinConfiguration : IConfigureOptions<OpenId
/// <inheritdoc/>
public void PostConfigure(string? name, OpenIddictServerOwinOptions options)
{
if (options is null)
{
throw new ArgumentNullException(nameof(options));
}
ArgumentNullException.ThrowIfNull(options);
if (options.AuthenticationMode is AuthenticationMode.Active)
{

16
src/OpenIddict.Server.Owin/OpenIddictServerOwinExtensions.cs

@ -24,10 +24,7 @@ public static class OpenIddictServerOwinExtensions
/// <returns>The <see cref="OpenIddictServerOwinBuilder"/> instance.</returns>
public static OpenIddictServerOwinBuilder UseOwin(this OpenIddictServerBuilder builder)
{
if (builder is null)
{
throw new ArgumentNullException(nameof(builder));
}
ArgumentNullException.ThrowIfNull(builder);
builder.Services.AddWebEncoders();
@ -71,15 +68,8 @@ public static class OpenIddictServerOwinExtensions
public static OpenIddictServerBuilder UseOwin(
this OpenIddictServerBuilder builder, Action<OpenIddictServerOwinBuilder> configuration)
{
if (builder is null)
{
throw new ArgumentNullException(nameof(builder));
}
if (configuration is null)
{
throw new ArgumentNullException(nameof(configuration));
}
ArgumentNullException.ThrowIfNull(builder);
ArgumentNullException.ThrowIfNull(configuration);
configuration(builder.UseOwin());

40
src/OpenIddict.Server.Owin/OpenIddictServerOwinHandlerFilters.cs

@ -28,10 +28,7 @@ public static class OpenIddictServerOwinHandlerFilters
/// <inheritdoc/>
public ValueTask<bool> IsActiveAsync(BaseContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
return new(_options.CurrentValue.EnableAuthorizationEndpointPassthrough);
}
@ -51,10 +48,7 @@ public static class OpenIddictServerOwinHandlerFilters
/// <inheritdoc/>
public ValueTask<bool> IsActiveAsync(BaseContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
return new(_options.CurrentValue.EnableEndSessionEndpointPassthrough);
}
@ -73,10 +67,7 @@ public static class OpenIddictServerOwinHandlerFilters
/// <inheritdoc/>
public ValueTask<bool> IsActiveAsync(BaseContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
return new(_options.CurrentValue.EnableErrorPassthrough);
}
@ -90,10 +81,7 @@ public static class OpenIddictServerOwinHandlerFilters
/// <inheritdoc/>
public ValueTask<bool> IsActiveAsync(BaseContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
return new(context.Transaction.GetOwinRequest() is not null);
}
@ -112,10 +100,7 @@ public static class OpenIddictServerOwinHandlerFilters
/// <inheritdoc/>
public ValueTask<bool> IsActiveAsync(BaseContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
return new(!_options.CurrentValue.DisableTransportSecurityRequirement);
}
@ -135,10 +120,7 @@ public static class OpenIddictServerOwinHandlerFilters
/// <inheritdoc/>
public ValueTask<bool> IsActiveAsync(BaseContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
return new(_options.CurrentValue.EnableTokenEndpointPassthrough);
}
@ -158,10 +140,7 @@ public static class OpenIddictServerOwinHandlerFilters
/// <inheritdoc/>
public ValueTask<bool> IsActiveAsync(BaseContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
return new(_options.CurrentValue.EnableUserInfoEndpointPassthrough);
}
@ -181,10 +160,7 @@ public static class OpenIddictServerOwinHandlerFilters
/// <inheritdoc/>
public ValueTask<bool> IsActiveAsync(BaseContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
return new(_options.CurrentValue.EnableEndUserVerificationEndpointPassthrough);
}

20
src/OpenIddict.Server.Owin/OpenIddictServerOwinHandlers.Authentication.cs

@ -81,10 +81,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ApplyAuthorizationResponseContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
if (context is not { BaseUri.IsAbsoluteUri: true, RequestUri.IsAbsoluteUri: true })
{
@ -145,10 +142,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public async ValueTask HandleAsync(ApplyAuthorizationResponseContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -231,10 +225,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ApplyAuthorizationResponseContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -292,10 +283,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ApplyAuthorizationResponseContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.

5
src/OpenIddict.Server.Owin/OpenIddictServerOwinHandlers.Device.cs

@ -77,10 +77,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ApplyEndUserVerificationResponseContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.

15
src/OpenIddict.Server.Owin/OpenIddictServerOwinHandlers.Session.cs

@ -61,10 +61,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ApplyEndSessionResponseContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
if (context is not { BaseUri.IsAbsoluteUri: true, RequestUri.IsAbsoluteUri: true })
{
@ -119,10 +116,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ApplyEndSessionResponseContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -179,10 +173,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ApplyEndSessionResponseContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.

120
src/OpenIddict.Server.Owin/OpenIddictServerOwinHandlers.cs

@ -78,10 +78,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ProcessRequestContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -132,10 +129,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ProcessRequestContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -177,10 +171,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ProcessRequestContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -224,10 +215,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ProcessChallengeContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
var properties = context.Transaction.GetProperty<AuthenticationProperties>(typeof(AuthenticationProperties).FullName!);
if (properties is not { Dictionary.Count: > 0 })
@ -302,10 +290,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ProcessChallengeContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
var properties = context.Transaction.GetProperty<AuthenticationProperties>(typeof(AuthenticationProperties).FullName!);
if (properties is not null)
@ -344,10 +329,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ProcessSignInContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
var properties = context.Transaction.GetProperty<AuthenticationProperties>(typeof(AuthenticationProperties).FullName!);
if (properties is not { Dictionary.Count: > 0 })
@ -423,10 +405,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ProcessSignOutContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
var properties = context.Transaction.GetProperty<AuthenticationProperties>(typeof(AuthenticationProperties).FullName!);
if (properties is not { Dictionary.Count: > 0 })
@ -501,10 +480,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -555,10 +531,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public async ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -641,10 +614,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public async ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -720,10 +690,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
Debug.Assert(context.Transaction.Request is not null, SR.GetResourceString(SR.ID4008));
@ -786,10 +753,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
Debug.Assert(context.Transaction.Request is not null, SR.GetResourceString(SR.ID4008));
@ -885,10 +849,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
Debug.Assert(context.Transaction.Request is not null, SR.GetResourceString(SR.ID4008));
@ -933,10 +894,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
switch (context.EndpointType)
{
@ -983,10 +941,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
Debug.Assert(context.Transaction.Response is not null, SR.GetResourceString(SR.ID4007));
@ -1049,10 +1004,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -1102,10 +1054,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -1169,10 +1118,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -1213,10 +1159,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
Debug.Assert(context.Transaction.Response is not null, SR.GetResourceString(SR.ID4007));
@ -1330,10 +1273,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -1378,10 +1318,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public async ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
Debug.Assert(context.Transaction.Response is not null, SR.GetResourceString(SR.ID4007));
@ -1437,10 +1374,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
Debug.Assert(context.Transaction.Response is not null, SR.GetResourceString(SR.ID4007));
@ -1479,10 +1413,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public async ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
Debug.Assert(context.Transaction.Response is not null, SR.GetResourceString(SR.ID4007));
@ -1553,10 +1484,7 @@ public static partial class OpenIddictServerOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
context.Logger.LogInformation(6145, SR.GetResourceString(SR.ID6145));
context.HandleRequest();

25
src/OpenIddict.Server.Owin/OpenIddictServerOwinHelpers.cs

@ -23,10 +23,7 @@ public static class OpenIddictServerOwinHelpers
/// <returns>The <see cref="IAppBuilder"/> instance.</returns>
public static IAppBuilder UseOpenIddictServer(this IAppBuilder app)
{
if (app is null)
{
throw new ArgumentNullException(nameof(app));
}
ArgumentNullException.ThrowIfNull(app);
return app.Use<OpenIddictServerOwinMiddlewareFactory>();
}
@ -38,10 +35,7 @@ public static class OpenIddictServerOwinHelpers
/// <returns>The <see cref="IOwinRequest"/> instance or <see langword="null"/> if it couldn't be found.</returns>
public static IOwinRequest? GetOwinRequest(this OpenIddictServerTransaction transaction)
{
if (transaction is null)
{
throw new ArgumentNullException(nameof(transaction));
}
ArgumentNullException.ThrowIfNull(transaction);
if (!transaction.Properties.TryGetValue(typeof(IOwinRequest).FullName!, out object? property))
{
@ -63,10 +57,7 @@ public static class OpenIddictServerOwinHelpers
/// <returns>The <see cref="OpenIddictServerEndpointType"/>.</returns>
public static OpenIddictServerEndpointType GetOpenIddictServerEndpointType(this IOwinContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
return context.Get<OpenIddictServerTransaction>(typeof(OpenIddictServerTransaction).FullName)?.EndpointType ?? default;
}
@ -78,10 +69,7 @@ public static class OpenIddictServerOwinHelpers
/// <returns>The <see cref="OpenIddictRequest"/> instance or <c>null</c> if it couldn't be found.</returns>
public static OpenIddictRequest? GetOpenIddictServerRequest(this IOwinContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
return context.Get<OpenIddictServerTransaction>(typeof(OpenIddictServerTransaction).FullName)?.Request;
}
@ -93,10 +81,7 @@ public static class OpenIddictServerOwinHelpers
/// <returns>The <see cref="OpenIddictResponse"/> instance or <c>null</c> if it couldn't be found.</returns>
public static OpenIddictResponse? GetOpenIddictServerResponse(this IOwinContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
return context.Get<OpenIddictServerTransaction>(typeof(OpenIddictServerTransaction).FullName)?.Response;
}

5
src/OpenIddict.Server.Owin/OpenIddictServerOwinMiddlewareFactory.cs

@ -37,10 +37,7 @@ public sealed class OpenIddictServerOwinMiddlewareFactory : OwinMiddleware
/// </returns>
public override Task Invoke(IOwinContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
var provider = context.Get<IServiceProvider>(typeof(IServiceProvider).FullName) ??
throw new InvalidOperationException(SR.GetResourceString(SR.ID0121));

2
src/OpenIddict.Server/OpenIddictServerHandlerDescriptor.cs

@ -142,7 +142,7 @@ public sealed class OpenIddictServerHandlerDescriptor
/// <returns>The builder instance, so that calls can be easily chained.</returns>
public Builder<TContext> SetType(OpenIddictServerHandlerType type)
{
if (!Enum.IsDefined(typeof(OpenIddictServerHandlerType), type))
if (!Enum.IsDefined(type))
{
throw new InvalidEnumArgumentException(nameof(type), (int) type, typeof(OpenIddictServerHandlerType));
}

5
src/OpenIddict.Validation.Owin/OpenIddictValidationOwinBuilder.cs

@ -36,10 +36,7 @@ public sealed class OpenIddictValidationOwinBuilder
/// <returns>The <see cref="OpenIddictValidationOwinBuilder"/> instance.</returns>
public OpenIddictValidationOwinBuilder Configure(Action<OpenIddictValidationOwinOptions> configuration)
{
if (configuration is null)
{
throw new ArgumentNullException(nameof(configuration));
}
ArgumentNullException.ThrowIfNull(configuration);
Services.Configure(configuration);

5
src/OpenIddict.Validation.Owin/OpenIddictValidationOwinConfiguration.cs

@ -18,10 +18,7 @@ public sealed class OpenIddictValidationOwinConfiguration : IConfigureOptions<Op
/// <inheritdoc/>
public void Configure(OpenIddictValidationOptions options)
{
if (options is null)
{
throw new ArgumentNullException(nameof(options));
}
ArgumentNullException.ThrowIfNull(options);
// Register the built-in event handlers used by the OpenIddict OWIN validation components.
options.Handlers.AddRange(OpenIddictValidationOwinHandlers.DefaultHandlers);

16
src/OpenIddict.Validation.Owin/OpenIddictValidationOwinExtensions.cs

@ -24,10 +24,7 @@ public static class OpenIddictValidationOwinExtensions
/// <returns>The <see cref="OpenIddictValidationOwinBuilder"/> instance.</returns>
public static OpenIddictValidationOwinBuilder UseOwin(this OpenIddictValidationBuilder builder)
{
if (builder is null)
{
throw new ArgumentNullException(nameof(builder));
}
ArgumentNullException.ThrowIfNull(builder);
// Note: unlike regular OWIN middleware, the OpenIddict validation middleware is registered
// as a scoped service in the DI container. This allows containers that support middleware
@ -62,15 +59,8 @@ public static class OpenIddictValidationOwinExtensions
public static OpenIddictValidationBuilder UseOwin(
this OpenIddictValidationBuilder builder, Action<OpenIddictValidationOwinBuilder> configuration)
{
if (builder is null)
{
throw new ArgumentNullException(nameof(builder));
}
if (configuration is null)
{
throw new ArgumentNullException(nameof(configuration));
}
ArgumentNullException.ThrowIfNull(builder);
ArgumentNullException.ThrowIfNull(configuration);
configuration(builder.UseOwin());

20
src/OpenIddict.Validation.Owin/OpenIddictValidationOwinHandlerFilters.cs

@ -28,10 +28,7 @@ public static class OpenIddictValidationOwinHandlerFilters
/// <inheritdoc/>
public ValueTask<bool> IsActiveAsync(BaseContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
return new(!_options.CurrentValue.DisableAccessTokenExtractionFromAuthorizationHeader);
}
@ -51,10 +48,7 @@ public static class OpenIddictValidationOwinHandlerFilters
/// <inheritdoc/>
public ValueTask<bool> IsActiveAsync(BaseContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
return new(!_options.CurrentValue.DisableAccessTokenExtractionFromBodyForm);
}
@ -74,10 +68,7 @@ public static class OpenIddictValidationOwinHandlerFilters
/// <inheritdoc/>
public ValueTask<bool> IsActiveAsync(BaseContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
return new(!_options.CurrentValue.DisableAccessTokenExtractionFromQueryString);
}
@ -91,10 +82,7 @@ public static class OpenIddictValidationOwinHandlerFilters
/// <inheritdoc/>
public ValueTask<bool> IsActiveAsync(BaseContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
return new(context.Transaction.GetOwinRequest() is not null);
}

65
src/OpenIddict.Validation.Owin/OpenIddictValidationOwinHandlers.cs

@ -80,10 +80,7 @@ public static partial class OpenIddictValidationOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ProcessRequestContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -133,10 +130,7 @@ public static partial class OpenIddictValidationOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ProcessAuthenticationContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -180,10 +174,7 @@ public static partial class OpenIddictValidationOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ProcessAuthenticationContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// If a token was already resolved, don't overwrite it.
if (!string.IsNullOrEmpty(context.AccessToken))
@ -232,10 +223,7 @@ public static partial class OpenIddictValidationOwinHandlers
/// <inheritdoc/>
public async ValueTask HandleAsync(ProcessAuthenticationContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// If a token was already resolved, don't overwrite it.
if (!string.IsNullOrEmpty(context.AccessToken))
@ -289,10 +277,7 @@ public static partial class OpenIddictValidationOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ProcessAuthenticationContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// If a token was already resolved, don't overwrite it.
if (!string.IsNullOrEmpty(context.AccessToken))
@ -340,10 +325,7 @@ public static partial class OpenIddictValidationOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ProcessChallengeContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
var properties = context.Transaction.GetProperty<AuthenticationProperties>(typeof(AuthenticationProperties).FullName!);
if (properties is not { Dictionary.Count: > 0 })
@ -418,10 +400,7 @@ public static partial class OpenIddictValidationOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(ProcessChallengeContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
var properties = context.Transaction.GetProperty<AuthenticationProperties>(typeof(AuthenticationProperties).FullName!);
if (properties is not null)
@ -459,10 +438,7 @@ public static partial class OpenIddictValidationOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
Debug.Assert(context.Transaction.Response is not null, SR.GetResourceString(SR.ID4007));
@ -509,10 +485,7 @@ public static partial class OpenIddictValidationOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -562,10 +535,7 @@ public static partial class OpenIddictValidationOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -629,10 +599,7 @@ public static partial class OpenIddictValidationOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.
@ -673,10 +640,7 @@ public static partial class OpenIddictValidationOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
Debug.Assert(context.Transaction.Response is not null, SR.GetResourceString(SR.ID4007));
@ -772,10 +736,7 @@ public static partial class OpenIddictValidationOwinHandlers
/// <inheritdoc/>
public ValueTask HandleAsync(TContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
// This handler only applies to OWIN requests. If The OWIN request cannot be resolved,
// this may indicate that the request was incorrectly processed by another server stack.

25
src/OpenIddict.Validation.Owin/OpenIddictValidationOwinHelpers.cs

@ -23,10 +23,7 @@ public static class OpenIddictValidationOwinHelpers
/// <returns>The <see cref="IAppBuilder"/> instance.</returns>
public static IAppBuilder UseOpenIddictValidation(this IAppBuilder app)
{
if (app is null)
{
throw new ArgumentNullException(nameof(app));
}
ArgumentNullException.ThrowIfNull(app);
return app.Use<OpenIddictValidationOwinMiddlewareFactory>();
}
@ -38,10 +35,7 @@ public static class OpenIddictValidationOwinHelpers
/// <returns>The <see cref="IOwinRequest"/> instance or <see langword="null"/> if it couldn't be found.</returns>
public static IOwinRequest? GetOwinRequest(this OpenIddictValidationTransaction transaction)
{
if (transaction is null)
{
throw new ArgumentNullException(nameof(transaction));
}
ArgumentNullException.ThrowIfNull(transaction);
if (!transaction.Properties.TryGetValue(typeof(IOwinRequest).FullName!, out object? property))
{
@ -63,10 +57,7 @@ public static class OpenIddictValidationOwinHelpers
/// <returns>The <see cref="OpenIddictValidationEndpointType"/>.</returns>
public static OpenIddictValidationEndpointType GetOpenIddictValidationEndpointType(this IOwinContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
return context.Get<OpenIddictValidationTransaction>(typeof(OpenIddictValidationTransaction).FullName)?.EndpointType ?? default;
}
@ -78,10 +69,7 @@ public static class OpenIddictValidationOwinHelpers
/// <returns>The <see cref="OpenIddictRequest"/> instance or <c>null</c> if it couldn't be found.</returns>
public static OpenIddictRequest? GetOpenIddictValidationRequest(this IOwinContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
return context.Get<OpenIddictValidationTransaction>(typeof(OpenIddictValidationTransaction).FullName)?.Request;
}
@ -93,10 +81,7 @@ public static class OpenIddictValidationOwinHelpers
/// <returns>The <see cref="OpenIddictResponse"/> instance or <c>null</c> if it couldn't be found.</returns>
public static OpenIddictResponse? GetOpenIddictValidationResponse(this IOwinContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
return context.Get<OpenIddictValidationTransaction>(typeof(OpenIddictValidationTransaction).FullName)?.Response;
}

5
src/OpenIddict.Validation.Owin/OpenIddictValidationOwinMiddlewareFactory.cs

@ -37,10 +37,7 @@ public sealed class OpenIddictValidationOwinMiddlewareFactory : OwinMiddleware
/// </returns>
public override Task Invoke(IOwinContext context)
{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);
var provider = context.Get<IServiceProvider>(typeof(IServiceProvider).FullName) ??
throw new InvalidOperationException(SR.GetResourceString(SR.ID0168));

1
src/OpenIddict.Validation.SystemNetHttp/OpenIddict.Validation.SystemNetHttp.csproj

@ -6,7 +6,6 @@
$(NetCoreTargetFrameworks);
$(NetStandardTargetFrameworks)
</TargetFrameworks>
<DefineConstants>$(DefineConstants);FeatureRuntimeInformation</DefineConstants>
</PropertyGroup>
<PropertyGroup>

2
src/OpenIddict.Validation/OpenIddictValidationHandlerDescriptor.cs

@ -142,7 +142,7 @@ public sealed class OpenIddictValidationHandlerDescriptor
/// <returns>The builder instance, so that calls can be easily chained.</returns>
public Builder<TContext> SetType(OpenIddictValidationHandlerType type)
{
if (!Enum.IsDefined(typeof(OpenIddictValidationHandlerType), type))
if (!Enum.IsDefined(type))
{
throw new InvalidEnumArgumentException(nameof(type), (int) type, typeof(OpenIddictValidationHandlerType));
}

Loading…
Cancel
Save