| name | migrating-aspnet-identity |
| description | Migrates ASP.NET MVC Identity to ASP.NET Core Identity, updating IdentityDbContext, UserManager, SignInManager, authentication middleware, and OWIN cleanup. Use when upgrading ASP.NET MVC projects that use Identity authentication, migrating Identity-based login systems, or converting OWIN-based auth to ASP.NET Core middleware. Triggers for Identity migration, auth upgrade, UserManager refactor, IdentityDbContext conversion, and OWIN removal.
|
| metadata | {"traits":".NET|CSharp|VisualBasic|DotNetCore","discovery":"lazy"} |
ASP.NET Identity to ASP.NET Core Identity Migration
Overview
Migrates ASP.NET MVC Identity to ASP.NET Core Identity: DbContext conversion, service registration, namespace updates, API changes, and OWIN cleanup.
Prerequisite
Verify the project uses ASP.NET Identity (e.g., references Microsoft.AspNet.Identity or IdentityDbContext). If not, skip and inform the user there is nothing to do.
Workflow
Migration Progress:
- [ ] Step 1: Install required packages
- [ ] Step 2: Update IdentityDbContext
- [ ] Step 3: Register DbContext and Identity in Program.cs
- [ ] Step 4: Add Identity middleware
- [ ] Step 5: Update Identity API usage
- [ ] Step 6: Update AccountController
- [ ] Step 7: Clean up OWIN identity code
Step 1: Install Required Packages
Ensure these NuGet packages are installed in the project (version major should match project's target framework):
Microsoft.AspNetCore.Identity.EntityFrameworkCore
Microsoft.EntityFrameworkCore.SqlServer
Microsoft.AspNetCore.Identity.UI
- (latest version)