Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Authorization] Cannot get token with Oauth authentication #1178

Open
salvorapi opened this issue Apr 12, 2024 · 2 comments
Open

[Authorization] Cannot get token with Oauth authentication #1178

salvorapi opened this issue Apr 12, 2024 · 2 comments

Comments

@salvorapi
Copy link

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.

@sigmavirus24
Copy link
Owner

Please provide information about what version of github3.py you have installed, how you installed it, and the exact exception / stack trace you're seeing.

https://github3.readthedocs.io/en/latest/api-reference/github.html#github3.github.GitHub.authorize authorize is a method on the GitHub object

@sigmavirus24
Copy link
Owner

Also if I remember correctly GitHub removed this API at some point but we haven't gotten around to pruning the methods and objects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants