是否可以将 ASP.NET Core Identity 添加到 WebForms 项目?
Is it possible to add ASP.NET Core Identity to a WebForms project?
我知道可以 to add ASP.NET Identity (note NOT Core) to a WebForms project. But what I want to do is add ASP.NET Core Identity 到现有的 WebForms 项目。
- 这可能吗?
- 如果 1. 不可能,那么我如何在我的 .NET Core 应用程序和 WebForms 应用程序之间共享一个 ASP.NET Core Identity 用户数据库,以便我可以实现 https://docs.microsoft.com/en-us/aspnet/core/security/cookie-sharing?view=aspnetcore-2.2#use-a-common-user-database
肯定可以共享数据库
选项 1:您需要执行一些自定义实现,因为 Core Identity (v3) 的架构可能与 .NET Framework Identity (v2) 略有不同。看看下面的linkhttps://docs.microsoft.com/en-us/aspnet/identity/overview/extensibility/index
如果它们是不同的实现,您可能还需要覆盖 PasswordHasher。查看以下文章:https://andrewlock.net/exploring-the-asp-net-core-identity-passwordhasher/
选项 2:您可以公开核心项目中的 login/registering/membership 功能,并将 WebForm 作为休息服务使用。有几种休息安全方案和中间件。
参见:
- https://garywoodfine.com/asp-net-core-2-2-jwt-authentication-tutorial/
- https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/secure-net-microservices-web-applications/
这些是一些快速的。您可能可以通过查看 Identity lib (https://github.com/aspnet/AspNetCore/tree/master/src/Identity) If you scroll down the readme you'll see different Store providers. For Option 1 you would need to essentially write a Core Store for your Web Forms Identity lib (https://archive.codeplex.com/?p=aspnetwebstack)
的源代码来推断并获得一些其他想法
我知道可以 to add ASP.NET Identity (note NOT Core) to a WebForms project. But what I want to do is add ASP.NET Core Identity 到现有的 WebForms 项目。
- 这可能吗?
- 如果 1. 不可能,那么我如何在我的 .NET Core 应用程序和 WebForms 应用程序之间共享一个 ASP.NET Core Identity 用户数据库,以便我可以实现 https://docs.microsoft.com/en-us/aspnet/core/security/cookie-sharing?view=aspnetcore-2.2#use-a-common-user-database
肯定可以共享数据库
选项 1:您需要执行一些自定义实现,因为 Core Identity (v3) 的架构可能与 .NET Framework Identity (v2) 略有不同。看看下面的linkhttps://docs.microsoft.com/en-us/aspnet/identity/overview/extensibility/index
如果它们是不同的实现,您可能还需要覆盖 PasswordHasher。查看以下文章:https://andrewlock.net/exploring-the-asp-net-core-identity-passwordhasher/
选项 2:您可以公开核心项目中的 login/registering/membership 功能,并将 WebForm 作为休息服务使用。有几种休息安全方案和中间件。
参见:
- https://garywoodfine.com/asp-net-core-2-2-jwt-authentication-tutorial/
- https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/secure-net-microservices-web-applications/
这些是一些快速的。您可能可以通过查看 Identity lib (https://github.com/aspnet/AspNetCore/tree/master/src/Identity) If you scroll down the readme you'll see different Store providers. For Option 1 you would need to essentially write a Core Store for your Web Forms Identity lib (https://archive.codeplex.com/?p=aspnetwebstack)
的源代码来推断并获得一些其他想法