Skip to content

Instantly share code, notes, and snippets.

@sigmavirus24
Created January 7, 2014 23:56
Show Gist options
  • Save sigmavirus24/8309169 to your computer and use it in GitHub Desktop.
Save sigmavirus24/8309169 to your computer and use it in GitHub Desktop.
Two-Factor Authentication in github3.py
import github3
def my_two_factor_callback():
auth_code = raw_input('Please enter your 2FA code: ')
return auth_code
g = github3.GitHub()
g.login(
'sigmavirus24',
'fake_password',
two_factor_callback=my_two_factor_callback
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment