Skip to content

A pure Python script that produces the same 2FA codes as the Google Authenticator App

License

Notifications You must be signed in to change notification settings

lzb112/google-authenticator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

google-authenticator

A pure Python script that produces the same TOTP codes as the Google Authenticator App

Expects a JSON file called 'secrets.json' in the current folder. The JSON file contains a dict mapping LABEL to SECRET.

If your machine doesn't have the right time, it won't show the right codes. You might have to do

sudo ntpdate time.nist.gov

The included PNG is a QR code that encodes the following URL:

otpauth://totp/example.org:grahammitchell?secret=ABCDEFGHIJKLMNOP&issuer=example.org

(I generated the QR code using Dan Hersam's QR Codes for Google Authenticator generator thingy. Super helpful.)

There's an "issuer" of example.org, a user of grahammitchell, and a "secret" of ABCDEFGHIJKLMNOP.

QR code for secret

This matches the provided secrets.json, so if you scan this QR code into your Google Authenticator app, your app should then produce the same codes as the python script here!

-Graham

About

A pure Python script that produces the same 2FA codes as the Google Authenticator App

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%