I'm trying to gain access to Tumblr's API via jsoauth. I successfully managed to get to run through all the steps entailed in the fetchRequestToken function, however I'm having trouble with fetchAccessToken. Chrome's log gave me the following error:
Object
requestHeaders: Object
responseHeaders: Object
text: "Missing or invalid oauth_verifier."
xml: ""
__proto__: Object
background.js:29
failureHandler
This is the code that's running:
var oauth, options;
options = {
consumerKey: 'MYKEY',
consumerSecret: 'MYSECRET',
};
oauth = OAuth(options);
oauth.fetchRequestToken(openAuthoriseWindow, failureHandler);
function openAuthoriseWindow(url)
{
var wnd = window.open(url, 'authorise');
oauth.fetchAccessToken(printKeys,failureHandler);
function printKeys(){
console.log(options.accessTokenKey);
console.log(options.accessTokenSecret);
}
}
function failureHandler(data)
{
console.error(data);
}
It's obviously something I'm doing wrong, but I'm not sure what. Not of the functions are particularly complicated since I'm just trying to get everything to work before adding in conditions. Have I executed something in the wrong order or missed a step?