【问题标题】:Unable to enable google oauth2 with devise无法使用设计启用 google oauth2
【发布时间】:2020-05-16 16:45:41
【问题描述】:

我正在尝试通过 google 启用 OAuth。我已经配置了该回调 URL,但是在尝试进行身份验证时出现错误提示

The redirect URI in the request, https://example.com/users/auth/google_oauth2/callback, does not match the ones authorized for the OAuth client

我将 Authorized JavaScript origins 设置为 https://example.com,并将重定向设置为 https://example.com/users/auth/google_oauth2/callback

我正在使用设计 4.3.3

【问题讨论】:

  • 重定向 uri 应该与 Google 中的设置完全匹配。通配符可能不起作用。您能否尝试在 Google 中设置完整的网址,即example.com/users/auth/google_oauth2/callback
  • @PrateekKumarDalbehera 这就是我已经拥有的
  • 但错误清楚地表明重定向 uri 中存在不匹配。它以 example.com 开头??

标签: ruby-on-rails oauth-2.0 devise google-oauth


【解决方案1】:

我的目标是跟踪 HTTPS 消息,以便您可以准确地看到通过网络发送的内容 - 使用 Fiddler 或 Charles 等工具。

Web UI 的标准消息类似于来自my write up 的消息。 Google 消息将是等效的。

希望这种方法能让您解决自己的问题。如果没有,请使用完整的 HTTP 消息详细信息更新您的问题

【讨论】:

    猜你喜欢
    • 2012-07-11
    • 2013-07-03
    • 2012-12-18
    • 1970-01-01
    • 2021-06-22
    • 2011-05-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多