Search code examples
c#asp.netangularasp.net-coreasp.net-identity

ASP.NET Identity vs ASP.NET Identity Core: Differences and Usage with Identity Server, etc.?


I used ASP.NET Identity before and now I want to use ASP.NET Identity Core in my ASP.NET Core + Angular app.

1. Is there any difference between ASP.NET Identity vs ASP.NET Identity Core? Or can we integrate ASP.NET Identity Core to an ASP.NET Core app as the same manner like ASP.NET Identity in ASP.NET MVC, etc?

2. Another point I am wondering is if we use Identity Server, can we still use ASP.NET Identity Core? Or is it unnecessary to use it and is Identity Server enough for performing all the stuff e.g. user and role management like ASP.NET Identity Core can do?

3. What about using only Angular side without any implementation on backen (ASP.NET Core) side? Is it possible or good idea to use it with Identity Server, OpenID Connect, etc.? Or should we stick on ASP.NET Core side for authentication, authorization and role management?


Solution

    1. Is there any difference between ASP.NET Identity vs ASP.NET Identity Core? Or can we integrate ASP.NET Identity Core to an ASP.NET Core app as the same manner like ASP.NET Identity in ASP.NET MVC, etc?

    It seems no breaking changes from ASP.NET Identity to ASP.NET Core Identity,you could check the document:

    https://learn.microsoft.com/en-us/aspnet/core/migration/identity?view=aspnetcore-5.0

    We could integrate Identity to ASP.NET Core project,you could refer to the document below:

    https://learn.microsoft.com/en-us/aspnet/core/security/authentication/scaffold-identity?view=aspnetcore-5.0&tabs=visual-studio

    1. Another point I am wondering is if we use Identity Server, can we still use ASP.NET Identity Core? Or is it unnecessary to use it and is Identity Server enough for performing all the stuff e.g. user and role management like ASP.NET Identity Core can do?

    Yes,you wan use Identity together with Identity Server.Furthermore,Identity Server can use ASP.NET Core Identity for user management, allowing the same OAuth/OpenID Connect functionality Microsoft Identity Platform provides, backed by ASP.NET Core Identity.

    1. What about using only Angular side without any implementation on backen (ASP.NET Core) side? Is it possible or good idea to use it with Identity Server, OpenID Connect, etc.? Or should we stick on ASP.NET Core side for authentication, authorization and role management?

    You can use Angular with Identity Server and OpenID Connect.As for sticking on Identity,it depends on you.

    IdentityServer will provide you with OAuth 2.0 and OpenID Connect implementation, and it will handle all details for you (providing you endpoints, token management, scopes, grants and so on). It runs independently so you can use it for multiple clients (SPA, mobile, web apps) and it is nicely isolated from rest of your app. If you wish so, you can use it together with ASP.NET Core Identity.