I am using Google Authenticator for 2FA on my .NET core application, framework 2.2.
Its working perfectly fine. Now, i want to replace that with Duo. I integrated DUO in the app but in the identity framework integration with DUO is not working. Need help as i am not sure how to make it work.
So, two factor is enabled on my login account, it first logs me in when i provide credentials, then it asks for 2FA code (as it previously was with Google Authenticator), there i have replaced that code page with DUO page and it asks me now to send the PUSH, i press it and it sends me the push, and that bit is working fine.
Here's the code to send the push, this bit is working fine.
if (result.RequiresTwoFactor)
{
var sign = Duo.Web.SignRequest(ikey, skey, akey, username);
ViewBag.sig_request = sign;
return View("DuoLogin");
}
Tried the following for two factor authentication, giving me failure in result.
string authenticated_username = Duo.Web.VerifyResponse(ikey, skey, akey, sig_response);
if (authenticated_username == username)
{
ViewBag.Message = "authenticated Successfully";
var result = await _signInManager.TwoFactorAuthenticatorSignInAsync(authenticated_username., rememberMe, Input.RememberMachine);
//OR
var result = _signInManager.TwoFactorAuthenticatorSignInAsync(authenticated_username, true, false);
//OR
var result = _signInManager.TwoFactorSignInAsync("Duo", sig_response, true, false);
}
The authenticate_username only brings back the username of DUO, there's no code to pass to 'TwoFactorSignInAsync' method.
UPDATE:
So, if you scan the QR code with DUO, you can use DUO in place of Google authenticator and it works fine. But still i would prefer to have a push authentication with DUO enabled.