Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

What's the difference between identity server and asp.net core identity?


Asked by Bryce Hickman on Nov 29, 2021 ASP.NET



Additionally, it is important to mention that ASP.NET Core Identity is a different thing from the Identity Server. ASP.NET Core Identity is a user store whilst the Identity Server offers protocol support for Open ID Connect. A lot of people mix these terms up.
Indeed,
Microsoft.AspNet.Identity.Core has nothing to do with ASP.NET Core, it's just a way to tell that it is the main (hence the word "core") library of ASP.NET Identity (pre-ASP.NET Core version). Since you are not using ASP.NET Core, you have to use Microsoft.AspNet.Identity.Core.
In this manner, IdentityServer is an authentication server that implements OpenID Connect (OIDC) and OAuth 2.0 standards for ASP.NET Core. It's designed to provide a common way to authenticate requests to all of your applications, whether they're web, native, mobile, or API endpoints.
Likewise,
So my question is can I use Microsoft.AspNetCore.Identity in MVC application or should I stick to Microsoft.Aspnet.Identity.Core? Microsoft.AspNet.Identity.Core has nothing to do with ASP.NET Core, it's just a way to tell that it is the main (hence the word "core") library of ASP.NET Identity (pre-ASP.NET Core version).
Besides,
AddAspNetIdentity adds the integration layer to allow IdentityServer to access the user data for the ASP.NET Core Identity user database. This is needed when IdentityServer must add claims for the users into tokens. Note that AddIdentity<ApplicationUser, IdentityRole> must be invoked before AddIdentityServer.