'Generated codes do not match with PyOTP sample
I was looking for a Python Time-based OTP library when I found PyOtp. I scanned the sample QR-Code
using Google Authenticator and ran the associated sample code
import pyotp
totp = pyotp.TOTP("JBSWY3DPEHPK3PXP")
print("Current OTP:", totp.now())
However, the codes on my phones and the codes which the application generates do not match. I also tried another library (SpookyOTP) and the codes also did not match. Generating my own key with PyOTP, instead of using the sample one, also did not make it work.
Obviously I am doing something wrong. The only thing that comes to my mind is that the two devices (my pc and my phone) somehow are not using the same timestamp for the generation of the code. But both devices show the same time on the clock.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

