Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between Microsoft.Extensions.Identity.Stores and Microsoft.Extensions.Identity.Core and Microsoft.AspNetCore.Identity?

Tags:

asp.net-core

I have a confused about three packages in asp.net core identity. I don't know what's the difference between each other. And also which of those should we use?

I found this link in GitHub, but I didn't get it.

Difference between Microsoft.Extensions.Identity.Stores and Microsoft.AspNetCore.Identity

like image 331
Behnam Avatar asked Mar 18 '20 08:03

Behnam


People also ask

What is Microsoft ASP.NET Core identity?

ASP.NET Core Identity: Is an API that supports user interface (UI) login functionality. Manages users, passwords, profile data, roles, claims, tokens, email confirmation, and more.

What is ASP.NET Core identity application?

ASP.NET Core Identity is a membership system that enables you to add login functionality to your application, allowing visitors to create an account and login with a user name and password from Facebook, Google or other external login providers.

What is Microsoft Aspnet identity Entityframework?

ASP.NET Identity is a new system of user authentication and authorization, that continues the evolution of ASP.NET membership system, and is used in the Visual Studio 2013 project templates for ASP.NET MVC, Web Forms, Web API and SPA. You can read more on ASP.NET Identity in Microsoft documentation.


1 Answers

  • Microsoft.Extensions.Identity.Core

This assembly contains the entity definition of the entire asp.net core Identity framework, roughly including IdentityUser,IdentityRole ,IdentityUserRole, IdentityUserClaim, IdentityRoleClaim, IdentityUserLogin.It can also be understood as a database table.

  • Microsoft.Extensions.Identity.Stores

This assembly is mainly used to perform basic CRUD to the above entities, including user management (UserManager) and role management (RoleManager), and some configurations that can be performed, such as user name restrictions, password verification, and so on. Specific storage implementations need to download other packages, such as Microsoft.AspNetCore.Identity.EntityFrameworkCore which is the implementation of data storage using EF Core.

  • Microsoft.AspNetCore.Identity

This assembly is used to manage authentication and authorization in the AspNetCore project, and also includes the basic configuration in the AspNetCore project. For example, to use the Identity framework, you need to execute services.AddIdentity <TUser> () in the ConfigureServices method.

Basic secondary development is based on the above core packages. If you want asp.net core Identity to support other ORM frameworks, such as Dapper, then you can use Microsoft.Extensions.Identity.Stores for secondary development. Or if some business logic does not meet your special needs, and it is also developed using this package.

If you want to extend the field, you need the Microsoft.Extensions.Identity.Core package, and inherit the relevant classes.

like image 133
Ryan Avatar answered Oct 09 '22 13:10

Ryan