I want to implment 2FA code generated by Google Authenticator in Python
The app Google Authenticator on Google Play generates 2-Step Verification for the services needed.
I've setup 2FA on my Google Account, they provided me the secret code in this form "bsnz bwpn tji6 flto 5enn 6vd4 wji7 aaaa", with noted "spaces don't matter"
So, I tried the following code in Python, but it does not work.
In Google Authenticator, I choosed "Time Based" already
The time on my computer, where script below running is the same as in my phone, where the Google Authenticator app is installed.
import pyotp, base64
totp = pyotp.TOTP( base64.b32encode("bsnz bwpn tji6 flto 5enn 6vd4 wji7 aaaa") )
print "Current OTP:" + totp.now()
The codes generated by Google Authenticator App and my code does not match.
What am I doing wrong ?