Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Primary key for Identity passkeys table too large #64548

Open
Labels
area-identityIncludes: Identity and providers
@davidkarlsson

Description

@davidkarlsson

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

ASP.NET Core Identity adds a new table for passkeys in .NET 10 called AspNetUserPasskeys by default and the primary key for this table is set to have a max length of 1024. This results in a warning when creating the table in SQL Server because the maximum key length for clustered indexes is 900 bytes:

Warning! The maximum key length for a clustered index is 900 bytes. The index 'PK_AspNetUserPasskeys' has maximum length of 1024 bytes. For some combination of large values, the insert/update operation will fail.

Expected Behavior

I'm not sure what the best solution would be but I expected the primary key to have a smaller max length than the maximum so that inserts/updates can't fail for large passkeys. So if the CredentialId can't be smaller than 1024 bytes because of the WebAuthn spec then perhaps another column should've been used as the primary key?

Steps To Reproduce

Configure EF Core with SqlServer and add Identity with IdentitySchemaVersions.Version3 and the initial migration will then add the AspNetUserPasskeys table with a primary key that's too large:

var connectionString = builder.Configuration.GetConnectionString("DefaultConnection") ?? throw new InvalidOperationException("Connection string 'DefaultConnection' not found.");builder.Services.AddDbContext<ApplicationDbContext>(options =>    options.UseSqlServer(connectionString));builder.Services.AddDatabaseDeveloperPageExceptionFilter();builder.Services.AddDefaultIdentity<IdentityUser>(options => {    options.SignIn.RequireConfirmedAccount = true;    options.Stores.SchemaVersion = IdentitySchemaVersions.Version3;})    .AddEntityFrameworkStores<ApplicationDbContext>();

Exceptions (if any)

No response

.NET Version

10.0.100

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-identityIncludes: Identity and providers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp