AddIdentity vs AddIdentityCore in ASP.NET Core
Codemia Knowledge Hub ·
`AddIdentity` sets up the full ASP.NET Core Identity stack, including user, role and sign-in services and cookie authentication. `AddIdentityCore` registers only the core pieces, such as user management, and leaves everything else (including cookie authentication) for you to configure. Choose `AddIdentity` for a ready-made setup and `AddIdentityCore` when you want a minimal, customized one.
ASP.NET Core Identity is a membership system that adds login functionality to an application: creating and managing user accounts, creating roles, and managing authentication tokens. It supports local accounts and external logins through services like Google or Facebook.
What AddIdentity registers
`AddIdentity` is part of the ASP.NET Core Identity package and covers the identity features you typically need out of the box:
- User and role management services: `UserManager`, `RoleManager` and `SignInManager`.
- Cookie authentication: Configures cookie-based authentication.
It does not add the default Identity UI by itself. That comes from `AddDefaultUI`, and `AddDefaultIdentity` is similar to calling `AddIdentity`, `AddDefaultUI` and `AddDefaultTokenProviders` together.
Trade-offs:
- Comprehensive functionality: Includes what a robust identity management system needs.
- Ease of use: Ready-to-use authentication mechanisms.
- Less customizable: Limited room to trim features you do not need.
What AddIdentityCore registers
- Minimal configuration: Only core features like user management.
- Extensibility: Better suited to scenarios where specific services need customization.
- No cookie authentication by default: Unlike `AddIdentity`, it does not set up cookie authentication.
- Highly configurable: You tailor the identity setup to your application's needs.
- Lighter: Because it is minimal, it can perform better when only essential features are required.
- More setup required: Especially for authentication mechanisms it does not provide out of the box.
Related reading
- Adding slave in PVM asks for password
- Algorithm Complexity Security MD5 or SHA1?
- Allowing Untrusted SSL Certificates with HttpClient
- Am I trying to connect to a TLS-enabled daemon without TLS?
- Adding an anonymous Task to ListTask does not execute it after calling .WaitAll C
- Adding an average parameter to .NET's Random.Next to curve results
- Amazon Cognito A client attempted to write unauthorized attribute
- Amazon DynamoDB InvalidSignatureException
System design interview problems on this topic
- Design a Secure Identity Management System: solution and walkthrough
- Design an API Rate Limiter: solution and walkthrough
- Design a Network Security Monitoring Tool: solution and walkthrough
- Design a CAPTCHA System: solution and walkthrough

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseSystem Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.