Custom ASP.NET Identity 2.0 UserStore - Is implementing all interfaces required?

前端 未结 3 982
醉酒成梦
醉酒成梦 2021-02-07 04:18

I\'ve created a custom IUserStore for my application. I\'ve implemented the interfaces I need,

   IUserStore,
           


        
3条回答
  •  不知归路
    2021-02-07 04:41

    Actually the IUserTwoFactorStore interface is really simple, so far my implementation (I don't use two factor auth either) is this:

     ....
     public Task GetTwoFactorEnabledAsync(User user)
     {
         return Task.FromResult(false);
     }
    
     public Task SetTwoFactorEnabledAsync(User user, bool enabled)
     {
         throw new NotImplementedException();
     }
    

    It works, although I just did it couple minutes ago and didn't test whole app thoroughly.

提交回复
热议问题