简体   繁体   English

AllAuth 安装

[英]AllAuth Installation

I'm attempting to install and configure Django AllAuth and I've run into a plethora of obstacles.我正在尝试安装和配置 Django AllAuth,但遇到了很多障碍。 I'm afraid I'm simply missing a few basic concepts which might clear some things up.恐怕我只是错过了一些可能会澄清一些事情的基本概念。

  1. In order to get basic social authentication working what setup needs to be done inside the social provider (Facebook, Twitter, etc.)为了使基本的社交身份验证正常工作,需要在社交提供者(Facebook、Twitter 等)内部进行哪些设置

  2. If this is the case then how would one develop locally because at first glance of Twitter's API setup it asks for redirect URLs which would get hairy considering everything right now is hosted locally.如果是这种情况,那么如何在本地开发,因为乍一看 Twitter 的 API 设置它要求重定向 URL,考虑到现在所有内容都在本地托管,这会变得很麻烦。

  3. When I try and go to /accounts/login/ it redirects to /accounts/profile/ every time.当我尝试转到/accounts/login/时,它每次都会重定向到/accounts/profile/ Can't seem to figure out what's causing this redirect.似乎无法弄清楚导致此重定向的原因。

  4. I was previously using Userena for my user authentication and was going to add Django-social-auth but when I got into it that was giving me difficulty.我以前使用 Userena 进行用户身份验证,并打算添加 Django-social-auth,但是当我进入它时,这给我带来了困难。 I then found AllAuth which seemed to fit my needs perfectly but again, having some issues.然后我发现 AllAuth 似乎完全符合我的需求,但又遇到了一些问题。 Can anyone weigh in on this decision, would you recommend one over the other and if so why?任何人都可以权衡这个决定,你会推荐一个而不是另一个,如果是,为什么?

Facebook Error: "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." Facebook 错误:“应用程序配置不允许给定 URL。:应用程序的设置不允许一个或多个给定 URL。它必须与网站 URL 或画布 URL 匹配,或者域必须是其中之一的子域应用程序的域。”

When I click okay it redirects back to my site.当我单击确定时,它会重定向回我的网站。 My browser gives me a security error and when I proceed through that I end up back at my site displaying: "Social Network Login Failure An error occurred while attempting to login via your social network account."我的浏览器给了我一个安全错误,当我继续进行时,我最终回到我的网站,显示:“社交网络登录失败尝试通过您的社交网络帐户登录时发生错误。”

1) Have a look here: https://speakerdeck.com/tedtieken/signing-up-and-signing-in-users-in-django-with-django-allauth 1)看看这里: https ://speakerdeck.com/tedtieken/signing-up-and-signing-in-users-in-django-with-django-allauth

(specifically, slide 61 and above) (具体来说,幻灯片 61 及以上)

2) Simply use 127.0.0.1:8000 in your redirect URLs 2) 只需在重定向 URL 中使用 127.0.0.1:8000

3) By default allauth redirects to LOGIN_REDIRECT_URL , which is set out of the box to /accounts/profile/: https://docs.djangoproject.com/en/dev/ref/settings/#login-redirect-url 3) 默认情况下, allauth重定向到LOGIN_REDIRECT_URL ,即设置为 /accounts/profile/:https://docs.djangoproject.com/en/dev/ref/settings/#login-redirect-url

4) As I am the author of allauth I will skip answering this question myself. 4)由于我是 allauth 的作者,我自己会跳过回答这个问题。 Browse through the complete presentation referred to by 1) -- the initial slides provide a good comparison of the various options.浏览 1) 提到的完整演示文稿——初始幻灯片提供了各种选项的良好比较。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM