![](/img/trans.png)
[英]twitter client javascript qml oauth 401 failed to validate signature and token
[英]getting error 401 unauthorized failed to validate oauth signature and token in twitter
我收到错误“无法验证oauth签名和未授权的令牌401”。 这是我的代码
<html>
<body>
<script type="text/javascript" src="jsOauth-1.3.1.js"></script>
<script type="text/javascript">
var options={
consumerKey: 'key',
consumerSecret: 'secret',
callbackUrl: 'url',
};
oauth=OAuth(options);
oauth.get("https://api.twitter.com/oauth/request_token",function(data){
requestparams=data.text;
console.log(options);
alert(data.text);
window.open("https://api.twitter.com/oauth/authorize?"+data);
},
function(data){alert("UnAuthorized...:("+data.text);}
);
</script>
</body>
</html>
您必须从Twitter获得一个ConsumerKey和consumerSecret。
为此,请转至以下URL: https : //dev.twitter.com/apps/new并使用您的Twitter帐户登录(如有必要)。
然后填写“应用程序详细信息”表单。 单击“创建您的Twitter应用程序”按钮后,您将获得需要用于ConsumerKey和ConsumerSecret的值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.