Django allauth如何使用Google账号登录

4

我正在使用django-allauth,尝试通过Gmail账户登录我的网站。我已经设置好了API。

Google 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的登录都成功了。请帮助我。
1个回答

3
你已经配置了一个HTTPS重定向URI,但你的Django应用程序使用HTTP URI。 要么在Google API控制台中添加http://tutor.herokuapp.com/accounts/google/login/callback,要么为你的Django项目使用HTTPS。

我太傻了,忘记了。你能指导我如何让雅虎登录也能正常工作吗?这会非常有帮助。我已经创建了API..我应该使用Openid还是有一个明确的雅虎配置? - flexxxit
目前,Yahoo的OAuth1尚未得到支持,但Yahoo提供的OpenID是受支持的。 - pennersr

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接