BlogCodeSamples icon indicating copy to clipboard operation
BlogCodeSamples copied to clipboard

2Fa sample invalid code

Open waltergrimmvie opened this issue 3 years ago • 1 comments

HI,

I ran the sample today, and used Google and MS authenticator to check the codes.

I verified that the Phone and PC are out of sync by 6 seconds,

Whenever I enter the codes from MS or Goo authenticator apps, I will always get an invalid response from the WPF app.

Does anyone please have some idea, what the issue could be?

thanx

waltergrimmvie avatar May 19 '22 08:05 waltergrimmvie

I'm not sure why that might be happening. The code should allow for being slightly out of sync, since it also calculates the OTP from 30 seconds ago (defined by DEFAULT_STEP) and allows that too. So 6 seconds should work okay.

If you've modified the code at all, can you post what you've changed?

Any chance the devices have separate timezones or something?

Do the OTP codes generated at the bottom of the app (like the ones below) match what you're seeing in the Authenticator app on the phone?

image

grantwinney avatar May 22 '22 04:05 grantwinney