Skip to content

fix: the Identity packages per target framework (Data Protection broke on net8.0) - #21

Open
donwibier wants to merge 1 commit into
masterfrom
fix/identity-packages-per-framework
Open

donwibier wants to merge 1 commit into
masterfrom
fix/identity-packages-per-framework

Conversation

@donwibier

Copy link
Copy Markdown
Owner

DX.Data.Xpo.Identity and DX.Data.Xpo.AutoMapper referenced Microsoft.Extensions.Identity.Core/.Stores 10.0.* for every target framework. On net8.0 that brings Microsoft.AspNetCore.Cryptography.KeyDerivation and .Internal 10 into the app, which replace .NET 8's own Cryptography.Internal. ASP.NET Core 8's Data Protection then calls a method that no longer exists:

System.MissingMethodException: Method not found: 'Boolean Microsoft.AspNetCore.Cryptography.CryptoUtil.TimeConstantBuffersAreEqual(Byte[], Int32, Int32, Byte[], Int32, Int32)'
   at Microsoft.AspNetCore.DataProtection.Managed.ManagedAuthenticatedEncryptor.Decrypt(...)

So on Linux every Identity token (password reset, e-mail confirmation, login links) and every antiforgery check fails. Windows uses the CNG encryptor, which doesn't call that method, so it went unnoticed (found running KwikEat Merchant, net8.0, locally on Linux).

Fix: the Identity packages per target framework: 8.0.* for net8.0, 9.0.* for net9.0, 10.0.* for net10.0 (property AspNetIdentityVersion). The other Microsoft.Extensions.* packages stay at 10.0.*; those are supported on net8.0.

The packages that depend on these are bumped too, so a fresh install resolves the fixed version (as in #19):

Package Version
DX.Data.Xpo.Identity 26.1.3.38 → 26.1.3.39
DX.Data.Xpo.AutoMapper 26.1.3.36 → 26.1.3.37
DX.Data.Xpo.Identity.Mapster 26.1.3.38 → 26.1.3.39
DX.Data.Xpo.Identity.AutoMapper 26.1.3.37 → 26.1.3.38
DX.Blazor.Identity 26.1.3.31 → 26.1.3.32
DX.Blazor.Identity.Server 26.1.3.29 → 26.1.3.30
DX.Blazor.Identity.Wasm 26.1.3.29 → 26.1.3.30

Tested

  • DX.Data.Xpo.Identity and DX.Data.Xpo.AutoMapper build for all target frameworks.
  • DX.Data.Xpo.Identity.Tests: 17/17 on net8.0 and net10.0 (net9.0 left to CI: no .NET 9 runtime on the dev box).
  • KwikEat Merchant (net8.0) built against this branch now gets Cryptography.Internal 8.0.32; on Linux a signup mail's login link logs in again, without copying the 8.0 DLL by hand.

🤖 Generated with Claude Code

DX.Data.Xpo.Identity and DX.Data.Xpo.AutoMapper referenced Microsoft.Extensions.Identity.Core/.Stores
10.0.* for every target framework. On net8.0 that brings Microsoft.AspNetCore.Cryptography.KeyDerivation
and .Internal 10 into the app, which replace .NET 8's own Cryptography.Internal; ASP.NET Core 8's Data
Protection then calls a method that isn't there any more (MissingMethodException in
ManagedAuthenticatedEncryptor), so on Linux every token (password reset, e-mail confirmation, login
links) and antiforgery check fails. Windows uses the CNG encryptor and didn't show it.

Now 8.0.* for net8.0, 9.0.* for net9.0, 10.0.* for net10.0. The packages that depend on these are bumped
too, so a fresh install resolves the fixed version:

  DX.Data.Xpo.Identity            26.1.3.38 -> 26.1.3.39
  DX.Data.Xpo.AutoMapper          26.1.3.36 -> 26.1.3.37
  DX.Data.Xpo.Identity.Mapster    26.1.3.38 -> 26.1.3.39
  DX.Data.Xpo.Identity.AutoMapper 26.1.3.37 -> 26.1.3.38
  DX.Blazor.Identity              26.1.3.31 -> 26.1.3.32
  DX.Blazor.Identity.Server       26.1.3.29 -> 26.1.3.30
  DX.Blazor.Identity.Wasm         26.1.3.29 -> 26.1.3.30

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant