Skip to content

Add a note about migrations and options to the Identity customization page #35825

@AndriySvyryd

Description

@AndriySvyryd

Description

When Identity options that affect the model are used, such as

.AddDefaultIdentity<ApplicationUser>(options =>
    {
        options.Stores.SchemaVersion = IdentitySchemaVersions.Version2;
        options.Stores.MaxLengthForKeys = 256;
        options.SignIn.RequireConfirmedAccount = false;
    })

EF tooling might not pick them up when generating or applying migrations, see dotnet/efcore#36314

To make sure that they are used consistently the app needs to be specified as the startup project when running the tools or, alternatively, implement IDesignTimeDbContextFactory:

Page URL

https://learn.microsoft.com/en-us/aspnet/core/security/authentication/customize-identity-model?view=aspnetcore-9.0&source=docs

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/security/authentication/customize-identity-model.md

Document ID

8750939b-6ae5-3b9a-6c32-5e84b7fea22c

Platform Id

e4bc952a-aa0d-f291-ecc1-9a6c25503108

Article author

@ajcvickers

Metadata

  • ID: d9869895-9ba2-5027-46cd-89d1d995cba4
  • PlatformId: e4bc952a-aa0d-f291-ecc1-9a6c25503108
  • Service: aspnet-core
  • Sub-service: security

Related Issues

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions