TwoFacAuth.ValidateTwoFactorPIN every time retuns false
See original GitHub issuebool isValid = TwoFacAuth.ValidateTwoFactorPIN(UserUniqueKey, token);
I have tried above code but, the code always returning false even if unique key and token is correct.
Issue Analytics
- State:
- Created 4 years ago
- Comments:10
Top Results From Across the Web
asp.net mvc - Google Authenticator ValidateTwoFactorPIN ...
I found my problem. It was with time zone. I set automatic time and zone and now is working good. thanks every body....
Read more >Strengthening Security with Two-Factor Authentication ...
TwoFactorAuthenticator TwoFacAuth = new TwoFactorAuthenticator(); return TwoFacAuth.ValidateTwoFactorPIN(googleAuthKey, token, validationWindow); }
Read more >Google 2 Step Authenticator - MVC 5.0 ASP.Net C# ...
Implement google 2 step authentication in any existing MVC C# Project. ... bool status = false; //check UserName and password form our ...
Read more >TwoFactorAuthenticator.ValidateTwoFactorPIN C# ...
Any () == false) { return(Task.FromResult(false)); } var key = result.First().Value; var validToken = twoFactorAuthenticator.ValidateTwoFactorPIN(key ...
Read more >Implement two-factor authentication in ASP.NET Core
TwoFactorEnabled is false or a Disable two-factor authentication button ... This class will help us throughout this example, every time we ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@dfibuch Yes, I’m not sure why the default is 5 minutes where the RFC only really allows 60 (to allow the expiring code to work). But I’m glad you were able to figure out the issue!
I’ve just been playing around with the example from Dot Net Detail and had the problem where it would validate an old token, which I don’t think it should. I read through the convo here and it’s the timeout on the
ValidateTwoFactorPIN
method that I didn’t set, so I changed it to:TwoFacAuth.ValidateTwoFactorPIN(UserUniqueKey, token, TimeSpan.FromSeconds(30));
And now it only validates the active token.