一键导入
owin-identity
Addressing ASP.NET Identity dependency while upgrading from ASP.NET (.NET Framework) to ASP.NET Core.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Addressing ASP.NET Identity dependency while upgrading from ASP.NET (.NET Framework) to ASP.NET Core.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
EF6 to EF Core migration policy for .NET Framework to modern .NET upgrades. Use when: assessing EF6 usage, planning package compatibility, multitargeting projects with Entity Framework 6. EF Core is NOT supported on .NET Framework — EF6 packages must be retained during framework-to-modern-dotnet migration and only migrated to EF Core as a separate post-migration effort.
Launch a .NET Framework ASP.NET project using IIS Express from the command line, replicating how Visual Studio would run it. Use when the user wants to start, run, or test the web app locally during migration. Do NOT use for .NET Core or modern .NET apps — use dotnet run instead.
System.Web adapters migration policy for ASP.NET Framework to ASP.NET Core. Use when: migrating System.Web.HttpContext, HttpRequest, HttpResponse, IHttpModule, IHttpHandler, HttpApplication, Global.asax, or other System.Web types to ASP.NET Core. Adapters are the DEFAULT approach during migration to minimize code changes. Covers adapter packages, property translations, incremental IHttpModule/IHttpHandler support, and behavioral differences (lifetime, threading, buffering). Native ASP.NET Core rewrite is a post-migration optimization.
Windows Service migration policy for .NET Framework ServiceBase to modern .NET BackgroundService. Use when: migrating System.ServiceProcess.ServiceBase, ServiceInstaller, ServiceProcessInstaller, or TopShelf-hosted services. The Generic Host + BackgroundService + Microsoft.Extensions.Hosting.WindowsServices pattern is the default approach. Both hosting packages target netstandard2.0 and .NET Framework 4.6.2+, enabling multitarget-first migration. Native rewrite from ServiceBase to BackgroundService can happen while still on net472.
Recommends the right GitHub Copilot customization type (instructions, prompt files, skills, agents, sub-agents, hooks) for a given intent. Use when the user asks which customization to use, whether something should be a skill or agent, or how to structure Copilot repo customizations.
Create and review skill files in .github/skills/. Use this skill when asked to create a new skill, review an existing skill, or improve skill quality. Applies best practices from agent-skills-best-practices.md to ensure skills are concise, discoverable, and effective.
基于 SOC 职业分类
| name | owin-identity |
| description | Addressing ASP.NET Identity dependency while upgrading from ASP.NET (.NET Framework) to ASP.NET Core. |
When upgrading ASP.NET applications that use classic ASP.NET Identity (the Microsoft.AspNet.Identity.* / OWIN-based stack) to ASP.NET Core, prefer continuing to use ASP.NET Identity and Entity Framework 6 via compatibility shims. This approach minimizes the amount of code that needs to be rewritten and allows for a smoother transition.
Microsoft.AspNetCore.Identity) then this scenario does not apply.To upgrade an ASP.NET application using ASP.NET Identity to ASP.NET Core, the preferred approach is to update the ASP.NET Core app to use OWIN middleware for authentication to configure the existing ASP.NET Identity setup (not ASP.NET Core Identity) to work within the ASP.NET Core application.
Hosting this OWIN pipeline in ASP.NET Core (in place of builder.Services.AddDefaultIdentity / AddIdentity / similar) might look like the following in program.cs:
builder.Services.AddAuthentication()
.AddOwinAuthentication("SharedCookie", (app, services) =>
{
// Configure the db context, user manager and signin manager to use a single instance per request
app.CreatePerOwinContext(ApplicationDbContext.Create);
app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create);
app.CreatePerOwinContext<ApplicationSignInManager>(ApplicationSignInManager.Create);
app.UseStageMarker(PipelineStage.Authenticate);
var dataProtector = services.GetDataProtectionProvider()
.GetCookieAuthenticationDataProtector("SharedCookie");
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new("/Account/Login"),
Provider = new CookieAuthenticationProvider
{
// Enables the application to validate the security stamp when the user logs in.
// This is a security feature which is used when you change a password or add an external login to your account.
OnValidateIdentity = Microsoft.AspNet.Identity.Owin.SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, ApplicationUser>(
validateInterval: TimeSpan.FromMinutes(30),
regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager))
},
// Settings to configure shared cookie with MvcCoreApp
CookieName = ".AspNet.ApplicationCookie",
TicketDataFormat = new AspNetTicketDataFormat(new DataProtectorShim(dataProtector))
});
});
Do
Microsoft.AspNetCore.SystemWebAdapters.Owin package to host the OWIN authentication pipeline within ASP.NET Core applications, as explained in this documentation and this sample.[Authorize] continues to work as before.Do Not