I've created a custom IUserStore<TUser,int>
for my application. I've implemented the interfaces I need,
IUserStore<TUser, int>,
IUserRoleStore<TUser, int>,
IUserLockoutStore<TUser, int>,
IUserPasswordStore<TUser, int>
but when I call
var result = await SignInManager.PasswordSignInAsync(model.UserName, model.Password, model.RememberMe, shouldLockout: false);
I get an exception saying
Store does not implement IUserTwoFactorStore<TUser>.
I'm not using two factor authentication anywhere in my application. Why does it expect me to implement that interface? Is it required that I implement all of these interfaces, even if I don't actually use them?
Actually the IUserTwoFactorStore
interface is really simple, so far my implementation (I don't use two factor auth either) is this:
....
public Task<bool> 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.