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