OAuth::问题(参数缺失)

发布于 2024-09-03 09:52:03 字数 734 浏览 2 评论 0原文

我正在使用 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'

我看到一些人面临这个问题,但我还没有弄清楚 解决这个问题的方法。希望对此提供一些帮助。

Im working with OAuth 0.3.6 and the linkedin gem for a Rails application and I have this issue where OAuth throws an error saying that OAuth::Problem (parameter_absent). The thing is it doesn't throw the error on every occasion its called and the problem is I am unable to reproduce the issue locally to test it.

The documentation says that :

[parameter_absent: a required parameter wasn't received. In this case,
the response SHOULD also contain an oauth_parameters_absent
parameter. ]

but the request is generated the same way each time to obtain the
tokens so I fail to understand why this happens.

Log

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'

I have seen a few people facing this issue but I am yet to figure out
a way to resolve this. Would appreciate some help on this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

长途伴 2024-09-10 09:52:03

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

The parameter_absent error means that you are not sending all of the required OAuth parameters to the endpoint. For the request token endpoint you need to insure that all of these parameters are present:

  • oauth_consumer_key
  • oauth_signature_method
  • oauth_signature
  • oauth_timestamp
  • oauth_nonce

For the accessToken endpoint the following parameters are required:

  • oauth_consumer_key
  • oauth_signature
  • oauth_signature_method
  • oauth_token
  • oauth_timestamp
  • oauth_verifier
平安喜乐 2024-09-10 09:52:03

我有类似的问题,想知道出了什么问题。最后才知道我忘记在提供密钥/秘密的生产服务器上设置环境变量。

不确定这是否与您的情况相同,我建议您检查环境变量(如果您正在使用它们)。

I has similar problem and was wondering what is wrong. Finally got to know that I forgot to set the Environment variable on the production server that was serving the keys/secrets.

Not sure that this is the same case with you, I would recommend you to check the env vars if you are using them.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文