【问题标题】:Google OAuth throwing edirect_uri_mismatch error谷歌 OAuth 抛出 redirect_uri_mismatch 错误
【发布时间】:2016-10-09 01:24:59
【问题描述】:

我正在尝试将 Google 身份验证添加到我的 Django 项目中。我已经能够将我的项目配置为使用不同的 Oauth 客户端对象在 Heroku 上使用我的应用程序,但我似乎无法让它在我的开发服务器上工作。

我不断收到错误:

Error: redirect_uri_mismatch
The JavaScript origin in the request, http://localhost:8000, does not match the ones authorized for the OAuth client. 

来自谷歌。

我的授权 Javascript 来源是:

https://localhost:8000
http://localhost:8000

我的授权重定向 URI 是:

https://localhost:8000
https://localhost:8000/
https://localhost
http://localhost:8000
http://localhost:8000/
http://localhost

(我根据类似问题的 cmets 尝试了所有这些组合。)

任何帮助或建议将不胜感激,因为我似乎无法在 API 文档的任何地方找到答案。

【问题讨论】:

    标签: django google-plus oauth2


    【解决方案1】:

    每次我在开发人员控制台中更改客户端时,我都忽略了在 Django 模板中进行相应的更新。我一直在使用错误的客户端 - 粗心的错误。

    【讨论】:

      猜你喜欢
      • 2014-06-20
      • 2014-11-02
      • 1970-01-01
      • 2013-07-04
      • 1970-01-01
      • 2014-02-09
      • 2015-04-03
      • 1970-01-01
      • 2012-10-28
      相关资源
      最近更新 更多