43

我创建了一个 Django 应用程序。该应用程序具有登录功能。

有人可以帮助找到一种可以使用 Facebook 凭据登录的方法,或者给我一些教程来实现它吗?

4

5 回答 5

79

Summary;


django-all-access


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.

django-allauth


Integrated set of Django applications addressing authentication, registration, account management as well as 3rd party (social) account authentication.

Supported Flows

  • Signup of both local and social accounts
  • Connecting more than one social account to a local account
  • Disconnecting a social account -- requires setting a password if only the local account remains
  • Optional instant-signup for social accounts -- no questions asked
  • E-mail address management (multiple e-mail addresses, setting a primary)
  • Password forgotten flow
  • E-mail address verification flow

Supported Providers

  • Dropbox (OAuth)
  • Facebook (both OAuth2 and JS SDK)
  • Github
  • Google (OAuth2)
  • LinkedIn
  • OpenId
  • Persona
  • SoundCloud (OAuth2)
  • Stack Exchange (OAuth2)
  • Twitch (OAuth2)
  • Twitter
  • Weibo (OAuth2)

Django Social Auth


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.

Supported Providers

  • Google OpenID
  • Google OAuth
  • Google OAuth2
  • Yahoo OpenID
  • OpenId like myOpenID
  • Twitter OAuth
  • Facebook OAuth

Django-Socialauth


What it does

  1. Allow logging in via various providers.
  2. Import contacts from various third party sites, to find out which of your friends already use our service.

Logging In

This is a application to enable authentication via various third party sites. In particular it allows logging in via

  • Twitter
  • Gmail
  • Facebook
  • Yahoo(Essentially openid)
  • OpenId

oauth2app


The oauth2app module helps Django site operators provide an OAuth 2.0 interface. The module is registered as an application.

django-oauth


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.

django-oauth-access


Supported Providers

  • Twitter
  • LinkedIn
  • Yahoo
  • Facebook (using OAuth 2.0 — it is functional, but needs more work)
  • Likely any OAuth 1.0a compliant site

django-oauth-consumer


A django application providing infrastructure for consuming OAuth services. It is not for providing OAuth services.


Also useful:

于 2011-04-03T15:45:28.303 回答
18

我强烈推荐使用django-social-auth。README 非常完整,它还包括针对其他 OAuth 源(例如 twitter)和 OpenID 源(例如 Google 和 Yahoo)进行身份验证的信息。当然,如果你只是想要 Facebook 身份验证,你可以使用它。

还有一个包含的示例应用程序,它为您提供了一些示例代码。

于 2011-04-03T18:42:50.340 回答
9

对于移动应用程序,如果您在后端使用 django 开发 ios/android 应用程序,您可以做的是使用 facebook ios/android api 在前端登录 facebook。但这不是您的应用程序的最终登录。在 facebook 登录后,facebook 会为您提供一个访问令牌,然后您可以将其与您的 facebook 用户名/电子邮件一起发送到您的 django 后端。在后面,django 可以使用facebook python sdk之类的东西通过与 facebook 通信来验证用户名-访问令牌对。如果通过验证,您最终可以为您的应用登录用户。

使用 python sdk 很容易,只需阅读教程,您将在几秒钟内与 facebook 通信。

于 2013-08-12T22:07:30.230 回答
1

我完全可以推荐django-allauth。它只是工作!

于 2017-01-04T14:28:53.200 回答
1

这样做的新方法是使用python-social-auth,因为 django-social-auth 已被弃用以支持 python-social-auth 并且现在支持除 Django 之外的其他框架,例如Flask、Pyramid、Web.py 和 Tornado

它还支持其他主要的身份验证提供商,例如Microsoft、Google、Twitter、Amazon、GitHub 等等

这是在 Django 上配置它的快速入门方法: 如何使用 Django 使用 Google+ API 登录?

于 2016-09-06T12:00:52.853 回答