Skip to content

Instantly share code, notes, and snippets.

@grantbachman
Last active August 29, 2015 14:14
Show Gist options
  • Save grantbachman/eeef59197860d188f67a to your computer and use it in GitHub Desktop.
Save grantbachman/eeef59197860d188f67a to your computer and use it in GitHub Desktop.
// https://developer.github.com/v3/oauth/#web-application-flow
// To generate the temp code, just send a GET request with this info (just enter into browser, it'll redirect to gdb.io)
//https://github.com/login/oauth/authorize/?client_id=a120596f26ba6f3148ea&scope=public_repo,repo,repo,repo_deployment,repo:status,gist,write:repo_hook,write:org
// With Meteor
var authHeaders= {'Accept':'application/json','User-Agent':'grantbachman'}
var authData= {'client_id':'a120596f26ba6f3148ea', // This is the app id
'client_secret':'XXXXXXXXXXXXXXXXXX', // This is the app secret
'code':'XXXXXXXX'} // This is the temp code from the first step
authenticate = function(){
HTTP.call('POST','https://github.com/login/oauth/access_token',{'headers':authHeaders,'data':authData},function(err,obj){console.log(err); console.log(obj)});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment