【发布时间】:2015-01-20 14:28:29
【问题描述】:
这是我目前的操作:
1./ 用户接受应用,应用回调将oauth_token 和oauth_token_secret 存储到数据库中(如access_token 和access_token_secret)。
2./我们使用 cli 脚本来处理自动发布到 twitter。我们加载 twitter oauth 对象如下:
public function post()
{
$consumerKey = $this->getConsumerKey();
$consumerSecret = $this->getConsumerSecret();
$accessToken = $this->getAccessToken();
$accessSecret = $this->getAccessSecret();
$twitteroauth = new TwitterOAuth($consumerKey,$consumerSecret,$accessToken,$accessSecret);
$message = $this->getPostMessage();
$result = $twitteroauth->post('statuses/update', array('status' =>$message));
$this->log($result);
}
现在假设我们正在使用分配给应用的 API 使用者密钥和秘密以及用户存储的访问令牌。
我们得到的结果是:
Invalid or expired token
我不太明白为什么我们会收到这个。我们正在使用 twitter 提供给我们的访问令牌和访问令牌秘密。
我确实注意到有一个GET 参数oauth_verifier。这不是我们需要在某处使用的东西吗?
无论如何,我不太确定这里出了什么问题。
发帖前我需要先登录吗?
【问题讨论】: