如何修复在Elastic Beanstalk上部署的django-allauth的“社交网络登录失败"错误 [英] How to fix 'Social Network Login Failure' error of django-allauth deployed on Elastic Beanstalk

查看:131
本文介绍了如何修复在Elastic Beanstalk上部署的django-allauth的“社交网络登录失败"错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用django-allauth插件在我的应用程序中提供Facebook登录. 登录在我的机器(localhost:8000)上可以正常工作,但是当我尝试登录部署在Elastic Beanstalk(AWS)上的在线版本时,它给了我这个错误:

I'm using django-allauth plugin to provide Facebook login in my application. The login works perfectly on my machine (localhost:8000) but it gives me this error when I try to login in the online version, deployed on Elastic Beanstalk (AWS):

社交网络登录失败 尝试通过您的社交网络帐户登录时发生错误.

Social Network Login Failure An error occurred while attempting to login via your social network account.

我已尝试按照以下说明对其进行调试,以获取更多信息:调试django-allauth社交网络登录失败, 但它没有提供有用的信息:

I've tried to debug it to get more information following this instructions: Debugging django-allauth Social Network Login Failure, but it gives no useful infromation:

{'provider': 'facebook', 'code': 'unknown', 'exception': None}

对于插件配置,我遵循了文档提供的指导. 而且我认为在FB应用程序设置中所有内容均已正确配置 (应用程序域,网站网址等)

For the plugin configuration I've followed the guidelines provided by the documentation. And I think that everything is correctly configured in the FB app settings (app domain, site url, etc.)

奇怪的是,即使该应用程序配置为可与在线版本一起使用(将应用程序域设置为我的真实域而不是本地主机),当我尝试从在线版本登录时,也会出现此错误,但是当我从localhost尝试运行时,它可以正常工作,而无需更改FB应用程序设置.

A strange thing is that even though the app is configured to work with the online version (set app domain to my real domain and not localhost) it gives me this error when I try the log in from the online version, but it works correctly when I try it from localhost, without changing the FB app settings.

推荐答案

在那里,使用aws cognito进行社交登录.

Been there, use aws cognito for social sign in.

以下是步骤 https://docs.aws. amazon.com/cognito/latest/developerguide/cognito-user-pools-social-idp.html

-------------或-------------------

------------- or -------------------

您可以python-social-auth( https://python-social- auth.readthedocs.io/en/latest/),就可以使用它进行配置了.现在我可以通过Facebook和Google登录到我的eb应用

you can python-social-auth (https://python-social-auth.readthedocs.io/en/latest/), just managed to configure using it. now i can login via facebook and google to my eb app

这篇关于如何修复在Elastic Beanstalk上部署的django-allauth的“社交网络登录失败"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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