Advertisement
Intermediate .NET, Authentication & Authorization (Identity, JWT, OAuth)

What is ASP.NET Core Identity, and what does it provide out of the box?

Short answer

ASP.NET Core Identity is a membership system providing user registration, password hashing and validation, email confirmation, two-factor authentication, external login providers (Google, Microsoft, Facebook), role management, and account lockout -- backed by a configurable data…

Save .NET mock interview
Advertisement
AModel answer
ASP.NET Core Identity is a membership system providing user registration, password hashing and validation, email confirmation, two-factor authentication, external login providers (Google, Microsoft, Facebook), role management, and account lockout -- backed by a configurable data store (commonly Entity Framework Core with a relational database), significantly reducing the boilerplate needed to implement secure user account management from scratch.
builder.Services.AddDefaultIdentity<IdentityUser>(options => {
    options.Password.RequireDigit = true;
    options.Password.RequiredLength = 8;
    options.SignIn.RequireConfirmedEmail = true;
}).AddEntityFrameworkStores<AppDbContext>();
Real-world example
A new web application uses ASP.NET Core Identity's scaffolded Razor Pages for login, registration, and password reset flows instead of building and securing this notoriously error-prone functionality from scratch.
Likely follow-ups
  • How do you customize the IdentityUser class to add custom profile fields?
  • How does Identity handle password hashing internally?
Related topics