ciaranj / node-oauth

OAuth wrapper for node.js
MIT License
2.44k stars 660 forks source link

Signature not working correctly. #336

Open Tarokan opened 6 years ago

Tarokan commented 6 years ago

I have the following code to communicate with the FatSecret API which uses OAuth 1.0.

` describe('OAuth1.0',function(){ var OAuth = require('oauth');

it('tests FatSecret API',function(done){ var oauth = new OAuth.OAuth( null, null, CONSUMER_KEY, CONSUMER_SECRET, '1.0', null, 'HMAC-SHA1', 32 ); oauth.get( 'http://platform.fatsecret.com/rest/server.api', PROFILE_TOKEN, //test user token PROFILE_SECRET, //test user secret
function (e, data, res){ if (e) console.error(e);
console.log(require('util').inspect(data)); done();
});
}); }); `

I'm getting this response: <?xml version="1.0" encoding="utf-8" ?>\r\n<error xmlns="http://platform.fatsecret.com/api/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://platform.fatsecret.com/api/1.0/ http://platform.fatsecret.com/api/1.0/fatsecret.xsd">\r\n\t<code>2</code>\r\n\t<message>Missing required oauth parameter: oauth_signature_method</message>\r\n</error>\r\n