OAuth ::问题(parameter_absent)

我正在使用OAuth 0.3.6和一个Rails应用程序的linkedin gem我有这个问题,其中OAuth抛出一个错误,说OAuth :: Problem(parameter_absent)。 问题是它不会在每次被调用时抛出错误,问题是我无法在本地重现问题来测试它。

文件说:

[parameter_absent:未收到必需参数。 在这种情况下,响应应该还包含oauth_parameters_absent参数。 ]

但是每次获取令牌时都会以相同的方式生成请求,因此我无法理解为什么会发生这种情况。

日志

OAuth::Problem (parameter_absent): oauth (0.3.6) lib/oauth/consumer.rb:167:in `request' oauth (0.3.6) lib/oauth/consumer.rb:183:in `token_request' oauth (0.3.6) lib/oauth/tokens/request_token.rb:18:in `get_access_token' linkedin (0.1.7) lib/linked_in/client.rb:35:in `authorize_from_request' app/controllers/users_controller.rb:413:in `linkedin_save' 

我看到有几个人面临这个问题,但我还没有找到解决这个问题的方法。 希望得到一些帮助。

parameter_absent错误表示您未将所有必需的OAuth参数发送到端点。 对于请求令牌端点,您需要确保所有这些参数都存在:

  • oauth_consumer_key
  • oauth_signature_method
  • oauth_signature
  • oauth_timestamp
  • oauth_nonce

对于accessToken端点,需要以下参数:

  • oauth_consumer_key
  • oauth_signature
  • oauth_signature_method
  • 组oauth_token
  • oauth_timestamp
  • oauth_verifier

我有类似的问题,并想知道什么是错的。 终于知道我忘了在提供密钥/秘密的生产服务器上设置Environment变量。

不确定这与你的情况是一样的,如果你使用它们,我建议你检查env vars。