Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

two factor authentication #10

Open
amarnathr210 opened this issue Apr 7, 2022 · 0 comments
Open

two factor authentication #10

amarnathr210 opened this issue Apr 7, 2022 · 0 comments

Comments

@amarnathr210
Copy link

amarnathr210 commented Apr 7, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant