liveBook · Manning

IdentityUser

As explained in ASP.NET Core in Action, 3e

IdentityUser is the standard ASP.NET Core Identity entity type representing a user account and its core account properties.

IdentityUser is the standard ASP.NET Core Identity entity for an application’s user accounts. It is stored in the database and supplies the account model used by the default registration, login, and user-management features. Extend it when the application needs additional user data; otherwise, the standard type is often sufficient. section 23.3.2 section 23.3.3

Register IdentityUser with EF Core

Configure Identity with the standard user type and connect it to an EF Core context: builder.Services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true).AddEntityFrameworkStores<ApplicationDbContext>(); ApplicationDbContext inherits from IdentityDbContext, which provides the Identity data model. Applying migrations creates the Identity tables, including AspNetUsers, where IdentityUser records are stored. section 23.3.3

The default Identity experience uses IdentityUser for several account operations:

  • Creates an account from an email address and password during registration. section 23.3.4
  • Supports unique email addresses, password policies, account confirmation, lockout, and optional MFA configuration. section 23.3.4
  • Works with UserManager<TUser> for creating, loading, and updating users, while SignInManager<TUser> handles sign-in and sign-out. section 23.7

How ASP.NET Core in Action, 3e covers it

How deep it goes
Explains configuration, EF Core storage, default account flows, and related managers, but stops short of detailing the complete entity schema.
Examples
Uses AddDefaultIdentity<IdentityUser>, ApplicationDbContext, the AspNetUsers table, registration pages, and account-management pages.
What it assumes
Assumes basic ASP.NET Core and EF Core configuration while introducing Identity services, user storage, registration, login, and management from the framework defaults.
What you can do after
Operate/configure IdentityUser with AddDefaultIdentity and EF Core, then manage accounts through the default UI and Identity managers.
How it connects
Connects IdentityUser to EF Core, IdentityDbContext, UserManager, SignInManager, claims, Razor Pages, and authentication cookies.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of ASP.NET Core in Action, 3e. The section links point to the parts of the book it draws on.