djangotwo-factor-authenticationgoogle-authenticator

Google Authenticator (Android) + Django says Invalid Token even after the Time Sync


I am trying to implement Multi Factor Authentication using django-two-factor-auth and Google Authenticator. But every time I scan the QR Code, it says "Entered token is not valid."

After researching a lot, I've tried following things:

I am using django 1.9 and latest version of Google Authenticator (Android). I don't what could be the possible reason.

Thanks.


Solution

  • I had the same problem and I fixed it with these steps:

    1. In console sudo ntpdate time.nist.gov
    2. Change my settings.py to:
    LANGUAGE_CODE = 'en-us'
    TIME_ZONE = 'America/Argentina/Buenos_Aires' 
    USE_I18N = True
    USE_L10N = True
    USE_TZ = True
    

    I hope to help.