github3.py
github3.py copied to clipboard
[Authorization] Cannot get token with Oauth authentication
Hi,
I try to use the code in the official documentation to get the OAuth token
https://github3.readthedocs.io/en/latest/examples/oauth.html
but with failure.
authorize
function is not available in github3 module.
I try with this script
from github3 import GitHub
gh = GitHub()
note = 'github3.py example app'
note_url = 'http://example.com'
scopes = ['user', 'repo']
gh.authorize(username="salvorapi", password="************",scopes=scopes, note=note, note_url=note_url)
salvorapi = gh.me()
print(salvorapi.name)
print(salvorapi.login)
Thanks, Salvo.