Last active
August 29, 2015 14:16
-
-
Save brittanydionigi/6dfaa3c2a7a4b1d2d5e9 to your computer and use it in GitHub Desktop.
oauth
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var oauth = new OAuth.OAuth( | |
'https://marketplace-dev.allizom.org/oauth/token', // request token URL | |
'https://marketplace-dev.allizom.org/oauth/authorize', // access token URL? | |
consumerKey, // user generated key from developers/api | |
consumerSecret, // user generated secret from developers/api | |
'1.0a', // oauth version | |
null, // callback | |
'HMAC-SHA1' // signature method | |
); | |
// once we have our oauth, then()... | |
oauth.getOAuthRequestToken(function(error, oauth_token, oauth_token_secret, results) { | |
if (error) { | |
console.log('error :', error) // GETTING A 500 ERROR AT THIS STAGE | |
} else { | |
console.log("Requesting access token") | |
oauth.getOAuthAccessToken(oauth_token, oauth_token_secret, function(error, oauth_access_token, oauth_access_token_secret, results2) { | |
// post to https://marketplace-dev.allizom.org/api/v2/apps/app using the oauth access token & secret | |
}); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment