What is ASP.NET Core Identity, and how does it provide a complete user account management system?
Short answer
ASP.NET Core Identity is a full membership system handling user registration, password hashing (using a strong, salted algorithm by default), email confirmation, two-factor authentication, account lockout after failed attempts, and role management -- backed by a configurable…
Advertisement
AModel answer
ASP.NET Core Identity is a full membership system handling user registration, password hashing (using a strong, salted algorithm by default), email confirmation, two-factor authentication, account lockout after failed attempts, and role management -- backed by a configurable data store, typically Entity Framework Core with a relational database -- dramatically reducing the notoriously error-prone work of building secure account management from scratch.
builder.Services.AddDefaultIdentity<IdentityUser>(options => {
options.Password.RequiredLength = 8;
options.SignIn.RequireConfirmedEmail = true;
}).AddEntityFrameworkStores<AppDbContext>();
// Scaffolded Razor Pages handle registration, login, password reset automaticallyReal-world example
A new web application uses ASP.NET Core Identity's scaffolded UI for login, registration, and password reset instead of hand-rolling this security-sensitive functionality, avoiding common pitfalls like weak password hashing or missing account lockout protection.
Likely follow-ups
- How does Identity's password hashing algorithm compare to rolling your own?
- How do you customize IdentityUser to add custom profile fields?
Related topics