我在一个网站的开发中使用django-allauth进行Facebook身份验证,并进行了相应的设置:
在facebok上的facebook应用程序设置中:
Namespace: test_login
App Domains: blank
Site URL: http://127.0.0.1:8000/
Canvas URL: http://127.0.0.1:8000/
Secure Canvas URL: https://127.0.0.1:8000/在Django admin中,我创建了一个新的社交应用:
Provider: Facebook
name: test_login
client_id: xxx
Secret: xxx
Sites: http://127.0.0.1:8000/如您所见,我添加了一个新的站点http://127.0.0.1:8000/而不是example.com。
settings.py中的SITE_ID是正确的。
所以一切都应该正常工作,但事实并非如此。在通过Facebook点击登录后,我得到
Given URL is not allowed by the Application configuration.:
One or more of the given URLs is not allowed by the App's settings.
It must match the Website URL or Canvas URL, or the domain must be a
subdomain of one of the App's domains.我遗漏了什么?什么是未配置的?据我所知,我应该能够使用127.0.0.1:8000进行测试。
发布于 2013-10-25 02:11:32
在Facebook中将url设置为localhost而不是127.0.0.1对我来说很有效。还要将localhost:8000传递给./manage.py runserver
发布于 2015-07-12 07:38:14
一小时前我也遇到了同样的问题。我已经通过将Site URL和Valid OAuth redirect URIs设置为http://fuf.me:8080来修复它。fuf.me指向127.0.0.1,所以您的本地主机,而且我已经将默认的8000端口更改为8080。您可以通过运行python manage.py runserver localhost:8080来完成此操作
此外,我还启用了浏览器OAuthLogin和WebOauthLogin。
https://stackoverflow.com/questions/16524499
复制相似问题