I'm using the latest 2.0.0-beta1 release of ASP.NET Identity and I don't want to utilise the new two-factor authentication support. In fact I want to remove the additional database columns EmailConfirmed, PhoneNumber, PhoneNumberConfirmed and TwoFactorEnabled but I can't see where I need to override the Identity classes to disable this functionality.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You need to implement your own UserStore to remove the functionality. The generic constraint on Identity.EntityFramework.UserStore is that the TUser is of type IdentityUser so you can't remove this while using the default EF implementation.
So you would implement your own IUserStore and not implement IUserTwoFactorStore or IUserPhoneNumberStore and then you also fully control what your tables look like.