【问题标题】:Given URL is not whitelisted in Client OAuth Settings : why am I getting this error?客户端 OAuth 设置中未将给定 URL 列入白名单:为什么会出现此错误?
【发布时间】:2016-01-21 18:43:48
【问题描述】:

我正在使用 django-allauth 和一个测试 Facebook 来测试身份验证。当我转到http://localhost/accounts/facebook/login 时出现以下错误:

Given URL is not whitelisted in Client OAuth Settings: This redirect
failed because the redirect URI is not whitelisted in the app’s Client
OAuth Settings. Make sure Client and Web OAuth Login are on and add all
your app domains as Valid OAuth Redirect URIs.

我在 Facebook 上的应用设置目前如下所示:

为什么会出现此错误,我该如何解决?

编辑:在设置 > 高级中,我在有效的 OAuth 重定向 URL 字段中设置了 http://localhost:8000/

【问题讨论】:

  • 设置 -> 高级
  • @CBroe :很抱歉,您是要我显示高级设置的屏幕截图吗?
  • 不,我说这是Valid OAuth Redirect URIs 输入字段所在的位置……(如果您只是费心环顾四周,您可能已经自己发现了a一点点在问之前......?)
  • @CBroe :我知道它在哪里。我用更多细节更新了问题。
  • 不是一切之后,而是直到next参数开始。如前所述,URL 编码必须颠倒。

标签: django facebook django-allauth


【解决方案1】:

检查登录对话框 URL 中 redirect_uri 参数的值 - 该值需要设置为 Valid OAuth Redirect URI

(当然,在将值放入登录对话框 URL 时应用的 URL 编码必须反转。)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-09-03
    • 2018-09-06
    • 2018-01-03
    • 2017-09-09
    • 2021-11-08
    • 2019-09-18
    • 1970-01-01
    • 2019-05-19
    相关资源
    最近更新 更多