我如何做一个叽叽喳喳OAuth回声validation呼叫?

我正在使用这个npm包来对Twitter进行OAuth Echovalidation: https : //github.com/ciaranj/node-oauth

有没有人有一个如何使用这个包来validation用户凭据的例子?

我可以正确地从iOS应用程序中获得X-Auth-Service-Provider&X-Verify-Credentials-Authorization,但是我在使用这个包时遇到了问题。

这里是OAuthEcho构造函数:

var oauthEcho = new OAuthEcho( "https://twitter.com", "https://api.twitter.com/1.1/account/verify_credentials.json", app.config.twitter.consumer_key, app.config.twitter.consumer_private_key, "1.0A", "HMAC-SHA1" ); 

任何帮助将真正感激!

谢谢!!

哇,我一直在说这一切都是错误的。 我实际上并不需要oauth模块。 我需要请求模块做一个简单的GET调用twitters API。

 // Setup the request object for OAuth Echo to twitter var options = { url: 'https://api.twitter.com/1.1/account/verify_credentials.json', headers: { 'Authorization': req.headers['x-verify-credentials-authorization'] } }; // Make the request request(options, function (error, response, body) { if (!error && response.statusCode == 200) { // If twitter responds with a 200, the echo call was authorized // TODO: do stuff next(); } else { res.send(401, 'Unauthorized'); next(); } });