简体   繁体   English

Twitter oAuth - 请求令牌

[英]Twitter oAuth - Request tokens

I'm using http://wordpress.org/extend/plugins/simple-twitter-connect/ to use twitter on a wordpress blog. 我正在使用http://wordpress.org/extend/plugins/simple-twitter-connect/在wordpress博客上使用twitter。 But I've a problem with request tokens. 但我对请求令牌有疑问。

Here's my code: 这是我的代码:

$to = new TwitterOAuth($options['consumer_key'], $options['consumer_secret']);
$tok = $to->getRequestToken();


function getRequestToken() {
    $r = $this->oAuthRequest($this->requestTokenURL());
    $token = $this->oAuthParseResponse($r);
    $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);
    return $token;
}

But after clicking on the sign in button, Twitter returns this: 但点击登录按钮后,Twitter会返回:

'Whoa there! “哇那里! There is no request token for this page. 此页面没有请求令牌。 That's the special key we need from applications asking to use your Twitter account.' 这是我们要求使用您的Twitter帐户的应用程序所需的特殊密钥。

The URL is https://twitter.com/oauth/authenticate?oauth_token= 该URL为https://twitter.com/oauth/authenticate?oauth_token=

Presumably the missing value is the problem. 据推测,缺失的价值就是问题所在。

I'm hoping to then allow the logged in user to tweet from the site, yet I haven't even gone near that with the above problem. 我希望然后允许登录用户从网站发推文,但我还没有接近上述问题。

Any ideas?? 有任何想法吗??

Haves you tried logging into Twitters Developer site ( https://dev.twitter.com/ ) to get your access token? 您尝试登录Twitters开发者网站( https://dev.twitter.com/ )获取访问令牌的Haves? If not you need to create an app which will allow access from your site to twiiter. 如果不是,您需要创建一个应用程序,允许从您的网站访问twiiter。 The Directions on the developer site are pretty easy to follow. 开发者网站上的路线非常容易理解。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM