我创建了一个 Django 应用程序。该应用程序具有登录功能。
有人可以帮助找到一种可以使用 Facebook 凭据登录的方法,或者给我一些教程来实现它吗?
我创建了一个 Django 应用程序。该应用程序具有登录功能。
有人可以帮助找到一种可以使用 Facebook 凭据登录的方法,或者给我一些教程来实现它吗?
django-all-access is a reusable application for user registration and authentication from OAuth 1.0 and OAuth 2.0 providers such as Twitter and Facebook.
The goal of this project is to make it easy to create your own workflows for authenticating with these remote APIs. django-all-access will provide the simple views with sane defaults along with hooks to override the default behavior.
There is a simple demo application running on at http://allaccess-mlavin.dotcloud.com/ The full source of this application is include in the repository.
Integrated set of Django applications addressing authentication, registration, account management as well as 3rd party (social) account authentication.
Django Social Auth is an easy way to setup social authentication/authorization mechanism for Django projects.
Crafted using base code from django-twitter-oauth and django-openid-auth, it implements a common interface to define new authentication providers from third parties.
This is a application to enable authentication via various third party sites. In particular it allows logging in via
The oauth2app module helps Django site operators provide an OAuth 2.0 interface. The module is registered as an application.
This is a forked version of David Larlet's django-oauth.
One very important difference is that this version requires that you be running a real cache behind Django's caching framework.
A django application providing infrastructure for consuming OAuth services. It is not for providing OAuth services.
Also useful:
我强烈推荐使用django-social-auth。README 非常完整,它还包括针对其他 OAuth 源(例如 twitter)和 OpenID 源(例如 Google 和 Yahoo)进行身份验证的信息。当然,如果你只是想要 Facebook 身份验证,你可以使用它。
还有一个包含的示例应用程序,它为您提供了一些示例代码。
对于移动应用程序,如果您在后端使用 django 开发 ios/android 应用程序,您可以做的是使用 facebook ios/android api 在前端登录 facebook。但这不是您的应用程序的最终登录。在 facebook 登录后,facebook 会为您提供一个访问令牌,然后您可以将其与您的 facebook 用户名/电子邮件一起发送到您的 django 后端。在后面,django 可以使用facebook python sdk之类的东西通过与 facebook 通信来验证用户名-访问令牌对。如果通过验证,您最终可以为您的应用登录用户。
使用 python sdk 很容易,只需阅读教程,您将在几秒钟内与 facebook 通信。
我完全可以推荐django-allauth。它只是工作!
这样做的新方法是使用python-social-auth,因为 django-social-auth 已被弃用以支持 python-social-auth 并且现在支持除 Django 之外的其他框架,例如Flask、Pyramid、Web.py 和 Tornado。
它还支持其他主要的身份验证提供商,例如Microsoft、Google、Twitter、Amazon、GitHub 等等。
这是在 Django 上配置它的快速入门方法: 如何使用 Django 使用 Google+ API 登录?