[英]Is it possible to add ASP.NET Core Identity to a WebForms project?
I know it is possible to add ASP.NET Identity (note NOT Core) to a WebForms project. 我知道可以将 ASP.NET标识(注意不是Core)添加到WebForms项目中。 But what I want to do is add ASP.NET Core Identity to an existing WebForms project. 但是我要做的是将ASP.NET Core Identity添加到现有的WebForms项目中。
It is definitely possible to share the database 绝对有可能共享数据库
Option 1 : you will need to do some custom implementation since Core Identity (v3) might have a slightly different schema than .NET Framework Identity (v2). 选项1 :您将需要执行一些自定义实现,因为Core Identity(v3)的架构可能与.NET Framework Identity(v2)略有不同。 Take a look at the following link https://docs.microsoft.com/en-us/aspnet/identity/overview/extensibility/index 看一下以下链接https://docs.microsoft.com/zh-cn/aspnet/identity/overview/extensibility/index
You might need to also override the PasswordHasher if they are different implementations. 如果它们是不同的实现,则可能还需要覆盖PasswordHasher。 Check the following article out: https://andrewlock.net/exploring-the-asp-net-core-identity-passwordhasher/ 请查看以下文章: https : //andrewlock.net/exploring-the-asp-net-core-identity-passwordhasher/
Option 2 : You can expose login/registering/membership functionality from your Core project and consume from your WebForm as a rest service. 选项2 :您可以从Core项目中公开登录/注册/会员功能,并从WebForm中将其用作休息服务。 There are several rest security schemes and middleware. 有几种其他的安全方案和中间件。
See: 看到:
Those are a few quick ones. 这些是一些快速的。 You can probably extrapolate and get some other ideas from looking at the source for Identity lib ( https://github.com/aspnet/AspNetCore/tree/master/src/Identity ) If you scroll down the readme you'll see different Store providers. 您可以通过查看Identity lib( https://github.com/aspnet/AspNetCore/tree/master/src/Identity )的源来推断并获得其他一些想法。如果向下滚动自述文件,则会看到不同的Store提供者。 For Option 1 you would need to essentially write a Core Store for your Web Forms Identity lib ( https://archive.codeplex.com/?p=aspnetwebstack ) 对于选项1,您实际上需要为Web窗体身份库( https://archive.codeplex.com/?p=aspnetwebstack )编写一个核心存储。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.