Disable two-factor authentication in ASP.NET Identity 2.0.0-beta1

I am using the latest version of ASP.NET Identity 2.0.0-beta1, and I do not want to use the new two-factor authentication support. Actually, I want to remove the extra database columns EmailConfirmed, PhoneNumber, PhoneNumberConfirmed and TwoFactorEnabled, but I don’t see where I need to override the Identity classes to disable this functionality.

+4
source share
1 answer

You need to implement your own UserStore in order to remove the functionality. The general limitation on Identity.EntityFramework.UserStore is that TUser is of type IdentityUser, so you cannot remove this using the standard default EF implementation.

So you have to implement your own IUserStore and not implement IUserTwoFactorStore or IUserPhoneNumberStore, and then you also have full control over how your tables look.

+2
source

Source: https://habr.com/ru/post/1527563/


All Articles