2013-07-23 59 views
0

嗨我正在製作一個應用程序,它們已經通過身份驗證後向用戶發佈時間線。我使用的庫和教程在這裏找到:twitteroauthtwitter API無法取回令牌

一切工作正常,直到我到達回調url並嘗試檢索訪問令牌和請求的var轉儲返回Invalid request token

下面的代碼:

function authenicateApp() { 

//Set app keys 

// Connect to twitter and recive token 
$connection = new TwitterOAuth('**', '**'); 
$temporary_credentials = $connection->getRequestToken('http://abc.def.com'); 

// Redirect to twitter authentation page 
header('location:'.$connection->getAuthorizeURL($temporary_credentials)); 
} 

function appPost() { 

$connection1 = new TwitterOAuth('**' ,'**', $_SESSION['oauth_token'], 
$_SESSION['oauth_token_secret']); 
var_dump($connection1->getAccessToken($_REQUEST['oauth_verifier'])); 
} 
+0

可能的重複http://stackoverflow.com/questions/11993423/why-does-this-twitter-oauth-api-token-request-fail – dseibert

+0

@dseibert這是一個截然不同的問題。 – abraham

回答

0

你有實際擁有$temporary_credentials到會話嘗試,當你創建$connection1使用會話之前。