Twitter登录 - 使用oauth_verifier时无效的请求令牌

时间:2015-10-22 10:05:59

标签: php twitter-oauth

我正在使用亚伯拉罕的TwitterOAuth库。

我正在调用我的请求网址,但当我回到网站使用oauth_verifier时,它会显示无效的请求令牌。

有什么想法吗?

我的prebuild.php

$twitteroauth  = new TwitterOAuth($consumerKey, $consumerSecret, $accessToken, $accessTokenSecret);
$request_token = $twitteroauth->oauth('oauth/request_token', array('oauth_callback' => 'http://www.website.com/triggerTwitter.php'));
$_SESSION['oauth_token'] = $request_token['oauth_token'];
$_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];
$twitterLoginUrl = $twitteroauth->url('oauth/authorize', array('oauth_token' => $request_token['oauth_token']));

我的网址很好,我现在需要获取用户数据。它授权很好所以当它回来时我在triggerTwitter.php上使用它

        $access_token = $twitteroauth->oauth("oauth/access_token", array("oauth_verifier" => $_REQUEST['oauth_verifier']));
        print_r($access_token);

请记住,第一部分也在开始时调用。

有什么想法吗?

0 个答案:

没有答案
相关问题