Skip to content

Instantly share code, notes, and snippets.

@jfsiii
Created December 24, 2011 19:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfsiii/1518200 to your computer and use it in GitHub Desktop.
Save jfsiii/1518200 to your computer and use it in GitHub Desktop.
authorize using GimmieBar API
console.log('get REQUEST token', clientId, clientSecret);
gimmeOauth.getRequestToken(clientId, clientSecret, function(error, token){
if (error) {
console.error(error);
} else {
console.log('got REQUEST token', token);
console.log('get ACCESS token', clientId, token);
gimmeOauth.getAccessToken(clientId, token, function(error, data) {
if (error) console.error(error);
else {
console.log('got ACCESS token', data);
if (data) {
gimmeOauth.requestAPI('/user', 'GET', data.username, data.access_token, function(err, data) {
console.log(3, arguments);
});
} else {
console.log('NO ACCESS token');
}
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment