api - Django allauth 使用谷歌账户登录

标签 api django-allauth

我正在使用 django-allauth 并尝试通过 gmail 帐户登录我的网站。我已经设置了api

谷歌API

Redirect URIs:  https://tutor.herokuapp.com/accounts/google/login/callback
JavaScript origins: https://tutor.herokuapp.com

但是当我点击谷歌链接登录时出现错误
Error: redirect_uri_mismatch
The redirect URI in the request: http://tutor.herokuapp.com/accounts/google/login/callback/ did not match a registered redirect URI

因为 Twitter 和 Facebook 登录成功,所以我不知道我哪里出错了。请帮助

最佳答案

您已经配置了 HTTPS 重定向 URI,而您的 Django 应用程序正在使用 HTTP URI。
要么加http://tutor.herokuapp.com/accounts/google/login/callback在 Google API 控制台,或为您的 Django 项目使用 HTTPS。

关于api - Django allauth 使用谷歌账户登录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17413828/

相关文章:

javascript - 通过 JavaScript 访问 Magento SOAP API : What am i doing wrong?

Java Mail API调用Server方法

javascript - 如何在 jQuery 中制作多语言键盘?

django-rest-framework - Django 使用 Allauth 进行休息验证

email - Django-allauth 从 webmaster@<servername> 发送验证邮件

python - 从 tensorflow Object Detection API 返回 Json 或一些漂亮的东西

php - 将 laravel 错误消息更改为 JSON for API

django - 在 django-allauth 中关闭用户社交注册?

python - 没有名为 rest_authusers 的模块错误

python - 如何使用allauth将范围参数设置为 strip 上的read_write?