开发者

Twitter Authentication "Could not authenticate you." error

Hey, I'm in the process of creating a new website which signs you in with your Twitter account. But when I'm testing the authentication I'm getting the a开发者_如何学编程bove error. Here's the whole thing I'm getting:

stdClass Object ( 
[request] => /1/account/verify_credentials.json?oauth_consumer_key=*********&oauth_nonce=*********************&oauth_signature=****************************&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1302636413&oauth_token=&oauth_version=1.0 
[error] => Could not authenticate you. 
) 

Please help if you know the solution.


Have you tried using Zend_Service_Twitter? A colleague has used it for some PHP-centric Twitter contracts, and hasn't had any complaints.

The call in your question would translate to this:

$twitter = new Zend_Service_Twitter(array(
    'username' => 'johndoe',
    'accessToken' => $token
));
$response = $twitter->account->verifyCredentials();

If you haven't already obtained the access token from Twitter, then use Zend_OAuth.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜