Skip to content

Instantly share code, notes, and snippets.

@fapestniegd
Created October 22, 2012 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fapestniegd/3932856 to your computer and use it in GitHub Desktop.
Save fapestniegd/3932856 to your computer and use it in GitHub Desktop.
# Github Oauth
# First, setup https authentication to not prompt for username and password
export GITHUB_PASSWORD='replace_this_with_your_github_password'
curl -u 'fapestniegd' -d '{"scopes":[],"note":"read-only token"}' https://fapestniegd:${GITHUB_PASSWORD}@api.git
# and empty scope means public read-only access (includes public user profile info, public repo info, and gists).
# see: => http://developer.github.com/v3/oauth/#scopes
# "scopes": [
# "user", # Read/write access to profile info only.
# "public_repo", # Read/write access to public repos and organizations.
# "repo", # Read/write access to public and private repos and organizations.
# "repo:status", # Read/write access to public and private repo statuses.
# # Does not include access to code - use repo for that.
# "delete_repo", # Delete access to adminable repositories.
# "gist", # Write access to gists.
# ],
# it will return some json like:
{
"scopes": [ ],
"created_at": "2012-10-22T17:06:52Z",
"url": "https://api.github.com/authorizations/748429",
"app": {
"url": "http://developer.github.com/v3/oauth/#oauth-authorizations-api",
"name": "read-only token (API)"
},
"note_url": null,
"updated_at": "2012-10-22T17:06:52Z",
"token": "1485723c684fdf8b788fe221904891b8851ee1a5",
"note": "read-only token",
"id": 748429
}
# you may then access a repository with the token
git clone https://1485723c684fdf8b788fe221904891b8851ee1a5:x-oauth-basic@github.com/fapestniegd/aufs2-standalone.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment