Skip to content

Instantly share code, notes, and snippets.

@brianyang
Last active December 18, 2015 12:19
Show Gist options
  • Save brianyang/5781606 to your computer and use it in GitHub Desktop.
Save brianyang/5781606 to your computer and use it in GitHub Desktop.
example web app OAuth flow
1. Redirect users to request GitHub access (public key)
GET https://github.com/login/oauth/authorize
2. GitHub redirects back to your site
* Exchange this for an access token: (private key)
POST https://github.com/login/oauth/access_token
3. Use the access token to access the API
GET https://api.github.com/user?access_token=...
req = $.ajax
url:'//site.com/api/v1/endpoint/'
type:'jsonp'
req.done (d) ->
console.log d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment