github3.py icon indicating copy to clipboard operation
github3.py copied to clipboard

[Authorization] Cannot get token with Oauth authentication

Open salvorapi opened this issue 10 months ago • 2 comments

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.

salvorapi avatar Apr 12 '24 17:04 salvorapi