Chrome Oauth library passing invalid argument
I'm trying to authenticate for the Yahoo Boss search API from a Chrome
extension.
So far I created the following code
var oauth = ChromeExOAuth.initBackgroundPage({
'request_url': 'https://yboss.yahooapis.com/ysearch/web',
'authorize_url': 'https://yboss.yahooapis.com/ysearch/web',
'access_url': 'https://yboss.yahooapis.com/ysearch/web',
'consumer_key': 'XXXXXXX',
'consumer_secret': 'XXXXXXXXX'
});
function callback(resp, xhr) {
// ... Process text response ...
console.log("resp" + resp);
console.log("xhr" + xhr);
}
function onAuthorized() {
var url = 'https://yboss.yahooapis.com/ysearch/web';
var request = {
'method': 'GET',
'parameters': {
'q': 'testquery',
'format': 'json',
'count': 10
}
};
oauth.sendSignedRequest(url, callback, request);
}
oauth.authorize(onAuthorized);
I'm using the Chrome Oauth library found at
http://developer.chrome.com/extensions/tut_oauth.html
and the Yboss data from
http://developer.yahoo.com/boss/search/boss_api_guide/oauth_model.html
When I run the extension the chrome_ex_oauth.html page gives the following
error in the console:
Failed to load resource: the server responded with a status of 400 (Bad
Request)
When I click on the link in the error I get
{
bossresponse: {
responsecode: "400",
reason: "Invalid parameter 'scope'"
}
}
It seems that the chrome library passes the following element:
scope=&xoauth_displayname=ChromeExOAuth%20Library
It seems to me that this is causing the error. Is there any way to switch
this off?
No comments:
Post a Comment