var request = require("request");
var oauth ={
consumer_key: "****************************",
consumer_secret: "****************************"
};
var url = 'https://www.tumblr.com/oauth/request_token'
request.post({url:url, oauth:oauth}, function (e, r, body) {
var temp1 = body.split("&");
var auth_token=temp1[0].split("=")[1];
var auth_secret=temp1[1].split("=")[1];
var tokens=[auth_token,auth_secret];
console.log(temp1)
cb(undefined,{d:tokens});
})
这个代码对我有用,试试这个。
tumblr没有合适的文档,但从文档中我了解到,有3种方法可以在tumblr中进行身份验证并接收auth\u令牌和auth\u令牌密钥。上述代码可能无法工作,因为auth\u nonce和auth\u签名发生了更改,因此您会收到以下错误:
oauth\u签名与预期值不匹配
因此,我建议使用我的方法来生成auth\u令牌和auth\u token\u secret。此代码在不添加任何签名和nonce的情况下工作