Charles Reid
22fd2b1307
|
7 years ago | |
---|---|---|
LICENSE | 7 years ago | |
README.md | 7 years ago | |
goop.py | 7 years ago | |
goop3.py | 7 years ago | |
moregoop.py | 7 years ago | |
oauth_test.py | 7 years ago |
README.md
goop
a hack to allow github oauth authentication for the command line.
what we need
we can programmatically request an oauth token URL from github and present it to the user, and they can log in and successfully grant permission to the app.
the problem happens when Github tries to return the oauth token that will allow us to do things on the user's behalf.
the problem
normally a third party service like Github returns the token via a JSON payload to a web server. but if we are developing a command line application, this is problematic.
github could solve the problem by just implementing a damn pin-based method but that would be too easy.
instead we need this ugly hack.
the solution
the solution is to set the callback url for our app to localhost:8000
and use the HTTP server built into Python to listen for the callback
URL and extract the token.