Source

py2fa / README.markdown

pyg2fa - Google two factor Authentication

Welcome

Welcome to g2fa. Google two factor auth for Python based apps.

Repo: $hg clone http://code.thejeshgn.com/pyg2fa

install:

hg clone http://code.thejeshgn.com/pyg2fa cd pyg2fa python setup.py install

Usage:

  • for test run
    import pyg2fa
    pyg2fa.test()
  • The test uses YOUR_SECRET_INITIAL_KEY, it should be at least 16, base 32 characters, this is secret, this could be different for different web app users
  • It will print the URL of QR code, Scan it using your Google Authenticator application
  • For testing enter the OTP generated by the Google Authenticator, the python program should print True if everything goes right.
  • make sure time on your comp and on your phone is in sync

Demo app:

  • cd pyg2fa/demo
  • python demo.py
  • follow the instructions

Ponder:

  • Clock on server and on android need to be in sync

Recent change:

  • Added validate method which will allow clients clock to drift server time by +/- defined seconds.
  • Developer documents and an demo web application

Tutorial