Skip to content

Instantly share code, notes, and snippets.

@Bogdaan
Forked from ozh/github_oauth_token.md
Created November 22, 2018 11:45
Show Gist options
  • Save Bogdaan/4e74e7b3a7726ae43e07fee5954612d7 to your computer and use it in GitHub Desktop.
Save Bogdaan/4e74e7b3a7726ae43e07fee5954612d7 to your computer and use it in GitHub Desktop.
Get a Github OAuth token from the CLI with curl

At the command line:

curl -u ':USERNAME' -d '{"scopes":["public_repo"],"note":"Google Issues to GH"}' https://api.github.com/authorizations
curl -H "Authorization: bearer :TOKEN" https://api.github.com/users/:USERNAME -I

Replace :USERNAME with your Github username and :TOKEN with the oauth token you get from first curl

After that, the token will be listed in your Applications and you can revoke it from there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment