IdentityServer4-Example
IdentityServer4-Example copied to clipboard
two factor authentication
i have a question twofactor authentication is outofbox feature so can we implement the twofactor authentication in the accountconntoller/login(postmethod) like. when the user is login to the application can we check user is eligible for the RequiresTwoFactor and then implement the customziation for the two factor authentication. var user = await _signInManager.UserManager.FindByNameAsync(model.Username);
// validate username/password using ASP.NET Identity var result= await _signInManager.CheckPasswordSignInAsync(user, model.Password, true)); if (user != null && result.Success) { //credential based authentication
} else if (result.RequiresTwoFactor) { //can we write our twofactor authentication here. } can you please help to correct me if i'm may wrong also. looking for best solution for twofactor authentication.