ASP.NET Core中使用外部Web服务进行自定义身份验证

时间:2016-11-06 20:50:09

标签: authentication asp.net-core asp.net-identity-3

我有外部网络服务,其中包含用户数据&我需要使用它来登录用户。如果可能的话,我想使用现有的AccountController + UI视图。我尝试添加自定义SignInManager 类来覆盖 PasswordSignInAsync ,如下所示。

public class MySignInManager<ApplicationUser> 
: SignInManager<ApplicationUser> where ApplicationUser : MyModels.ApplicationUser

但由于缺少存储用户信息的EF数据库而失败。我不需要EF数据库,因为这个外部Web服务将是我的数据源。

我读过我需要实现UserManager&amp; UserStore但无法找到ASP.NET Core版本的示例。有人能指出我吗?

1 个答案:

答案 0 :(得分:0)

我找到了这个实现 - Aspnet Core Identity Without Entityframework

Source code on Github

我认为这应该足够开始了。