IdentityServer4-Example icon indicating copy to clipboard operation
IdentityServer4-Example copied to clipboard

two factor authentication

Open amarnathr210 opened this issue 3 years ago • 0 comments

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.

amarnathr210 avatar Apr 07 '22 09:04 amarnathr210