如何使用Facebook在开发环境中使用django social-auth登录? [英] How to login using facebook in development environment using django social-auth?

查看:171
本文介绍了如何使用Facebook在开发环境中使用django social-auth登录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用社交知识与我的django网络应用程序。当我在生产环境中访问/ login / facebook时,用户可以使用他们的Facebook数据登录。但是在我的开发环境中,当我访问

  http:// localhost:8000 / login / facebook /,

我收到错误说

 发生错误。请稍后再试。 

API错误代码:191
API错误说明:指定的URL不属于应用程序
错误消息:无效的redirect_uri:给定的URL不被应用程序配置允许。

我相信这是因为域名是localhost:8000。我如何解决这个问题,所以我可以在开发环境中使用Facebook登录?

解决方案

我刚刚看到一个答案阅读Heroku / Facebook文档。



为此,您必须创建第二个应用程序并将其链接到本地​​主机,以便在本地测试。



您可以在这里找到更多信息: https://devcenter.heroku.com/articles/facebook#1-creating-a-development-facebook-app


I'm using social-auth with my django web app. When I go to /login/facebook in the production environment, the user is able to login using their facebook data. However in my development environment when I access

http://localhost:8000/login/facebook/, 

I get an error saying

An error occurred. Please try again later.

API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: Invalid redirect_uri: Given URL is not allowed by the Application configuration.

I believe this is because the domain is localhost:8000. How do I fix this so I can login using facebook in my development environment?

解决方案

I had just seen an answer for it while reading the Heroku/Facebook documentation.

To do that, you must create a second app and link it to your localhost in order to test it locally.

You can find more info about it here: https://devcenter.heroku.com/articles/facebook#1-creating-a-development-facebook-app

这篇关于如何使用Facebook在开发环境中使用django social-auth登录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆