【问题标题】:Twitter connect : 'Failed to validate oauth signature and token' using twitter-codeigniterTwitter 连接:“无法使用 twitter-codeigniter 验证 oauth 签名和令牌”
【发布时间】:2014-04-02 21:11:02
【问题描述】:

我正在尝试使用 php 中的 twitter-codeigniter 库连接 twitter。该库使用 twitteroauth 库进行授权。

作为第 1 步,我加载库并使用所需的回调作为参数调用重定向函数。

$this->load->library('twconnect'); 
$this->twconnect->twredirect('http://myserver.net/twconnect/callback/');

并且在回调中,所有推特授权所需的步骤都被执行。这是第一次正常工作。但再次执行 twitter 连接时,会引发以下错误:

Message: Undefined index: oauth_token
Filename: libraries/twconnect.php
Line Number: 128

在探索这个错误时,我发现这个错误是在 twconnect->twredirect() 函数中抛出的。它使用 twitteroauth 库向 twitter 请求输出令牌,但此请求失败并出现以下错误并且没有 oauth_token 返回。

Failed to validate oauth signature and token

我在stackoverflow中搜索了这个错误,很多人建议修复本地和twitter服务器时间之间的时间同步问题。我已经解决了这个问题。不过,问题还没有解决。

我猜这个库是第一次在会话中设置一些令牌信息。不知何故,oauth 令牌请求在第一次之后失败。如果有人知道此错误的修复方法,请提供帮助。

【问题讨论】:

    标签: php twitter oauth twitter-oauth


    【解决方案1】:

    oauth_token 可能不会被传递,因为 Code Igniter 会阻止查询字符串中的 oauth_token 变量。

    这里有类似的问题: Enable Query Strings in Code Igniter

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-24
      • 1970-01-01
      • 2011-02-26
      • 2014-10-08
      相关资源
      最近更新 更多