ASP.NET Core Identity 9.0

Last reviewed Oct 11, 2026

Export as PDF

Prompt Details

Prompt Composition

3prompts
  1. C# 13112 lines · 4.2K tokens
  2. ASP.NET Core 9.072 lines · 3.7K tokens
  3. ASP.NET Core Identity 9.064 lines · 3.4K tokens
Total248 lines · 11.3K tokens

CWE Coverage

  • 20
  • 22
  • 59
  • 73
  • 78
  • 79
  • 89
  • 94
  • 117
  • 190
  • 203
  • 204
  • 208
  • 209
  • 214
  • 257
  • 287
  • 295
  • 306
  • 307
  • 312
  • 319
  • 323
  • 327
  • 328
  • 338
  • 347
  • 352
  • 362
  • 367
  • 384
  • 426
  • 434
  • 502
  • 521
  • 524
  • 525
  • 532
  • 552
  • 601
  • 611
  • 613
  • 614
  • 620
  • 636
  • 639
  • 640
  • 732
  • 759
  • 770
  • 772
  • 798
  • 807
  • 829
  • 841
  • 862
  • 915
  • 916
  • 918
  • 922
  • 942
  • 1004
  • 1275
  • 1333
  • 1385
  • 1395

Prompt Preview

Use these rules for ASP.NET Core Identity 9.0 after applying the included ASP.NET Core 9.0 baseline. The scope is local accounts, Identity stores and managers, password authentication, cookies, account tokens, external providers, MFA, and MapIdentityApi. Identity ships in the ASP.NET Core shared framework, so it takes the runtime's servicing updates, while Microsoft.AspNetCore.Identity.UI and Microsoft.AspNetCore.Identity.EntityFrameworkCore are separate packages that move only when you update them.

Identity setup and store invariants

  • Register only the Identity feature set the product actually exposes. AddDefaultIdentity adds default UI and token providers, AddIdentity registers the configurable application/external/two-factor cookie stack, and AddIdentityApiEndpoints<TUser> activates both application cookies and proprietary bearer-token authentication.
  • Apply IdentityOptions after the registration call and assert production values at startup. Confirmation checks default off, so enable SignIn.RequireConfirmedAccount or the exact email/phone requirement when an account must prove control before authentication.
  • Use the stable Identity user ID for principals, audit records, ownership, and tenant joins. Email addresses, user names, external claims, and display names are mutable attributes and must not become authorization keys.
  • Define a canonical login namespace and enforce it transactionally. RequireUniqueEmail is false by default; if email identifies an account, enable it and add an equivalent unique constraint over the normalized database