5

I understand .NET Identity, but lots of articles are coming up about Identity 2 and Identity 3. The latter (Identity 3) seems to only work for .NET Core solutions. So was thinking of using Identity 2. But I'm not clear:

  • What are the difference between v2 and v3?
  • Is v2 still in support?
SJDoodle
  • 351
  • 3
  • 11
  • I have no idea about version numbers but `Microsoft.AspNetCore.Identity` is the package that brings “identity”, as in support for individual user accounts, into ASP.NET Core. It’s the only “ASP.NET Identity” package that integrates with ASP.NET Core, and it also only works for ASP.NET Core. The other “ASP.NET Identity” are usually targeted for the classic ASP.NET. – poke Dec 19 '17 at 09:30
  • Worth pointing out that Identity 3 has no direct versioning relationship with .NET Core 3 (which came out September 2019).Identity 3 came out a couple years before. And apart from changes to version numbers in package references (https://learn.microsoft.com/en-us/aspnet/core/migration/22-to-30) there's no 'new version' for .NET Core 3. It's just two things that just happen to be called '3'. – Simon_Weaver Oct 28 '19 at 06:01

2 Answers2

2

Your choice is simple. If you build MVC5 application you can only use Identity 2. If you are building ASP.Net Core application you can only use Identity 3.

Identity 2 is in support, but not in active development. I.e. bugs will be fixed, but no new features will be provided.

If you are starting a new project, then I don't see a reason to use MVC5. All green-field projects should be done in ASP.Net Core with Identity 3

trailmax
  • 34,305
  • 22
  • 140
  • 234
1

You can use identity 2 in Asp.Net Core and mantain the passwordhash in the database. Just add this code in startup.cs

 services.Configure<PasswordHasherOptions>(options => {
          options.CompatibilityMode = PasswordHasherCompatibilityMode.IdentityV2;
      });
Adrian
  • 655
  • 6
  • 10
  • By the way... I am using Asp.Net Core and asp.net web form with identity v2. – Adrian Jun 26 '18 at 15:50
  • I have tried this and it doesn't seem to work. Is there an article somewhere that you know of that covers this topic? – jfielaidof Oct 23 '18 at 19:59
  • Remember @jfielaidof that you need to create again the user (with the identityV2 implementation), because the token is different in identity v2 than identity 3. – Adrian Nov 02 '18 at 09:17