How to make Facebook Login possible in Django app ?

30,549

Solution 1

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:

Solution 2

I highly recommend using django-social-auth. The README is very complete, and it also includes information for authenticating against other OAuth sources such as twitter, and against OpenID sources like Google and Yahoo. Of course, if you just wanted Facebook authentication, you can just use it for that.

There's also an included example application, which gives you some sample code to play with.

Solution 3

FOR MOBILE APPLICATION, if you are developing an application for ios/android with django in the backend, what you can do is login to facebook in the frontend using the facebook ios/android api. But this is not the final login for your app. Upon facebook-login, facebook gives you an access token which you can then send to your django backend along with your facebook username/email. In the back, django can use something like facebook python sdk to verify the username-access token pair by communicating with facebook. If verified, you can finally log in the user for your app.

Using the python sdk is easy, just read the tutorial and you will be communicating with facebook in seconds.

Solution 4

The new way of doing that is by using python-social-auth, as django-social-auth was deprecated in favor of python-social-auth and now supports other frameworks than Django such as Flask, Pyramid, Web.py and Tornado.

It also supports other major auth providers such as Microsoft, Google, Twitter, Amazon, GitHub and many more.

Here is a quick get-started way to configure it on Django: How to sign in with the Google+ API using Django?

Solution 5

I can totally recommend django-allauth. It just works!

Share:
30,549

Related videos on Youtube

rv_k
Author by

rv_k

Software Developer

Updated on January 05, 2020

Comments

  • rv_k
    rv_k over 4 years

    I have created a Django application. The app has a login functionality.

    Can somebody help to find a way to make it possible to login using Facebook credential or point me some tutorials to implement it ?

  • vault
    vault over 10 years
    django-social-auth has now moved to python-social-auth. I really liked the project, unfortunately it doesn't work on django & google app engine.
  • devsnd
    devsnd about 10 years
    django-social-auth is now deprecated. The successor is github.com/omab/python-social-auth
  • Alireza Savand
    Alireza Savand over 9 years
    @vault it does via its own apps.django_app package.
  • vault
    vault over 9 years
    thank you for the information, but I don't have any more interest in testing it for the moment. Just to be clear, I've read it supports google app engine auth, but what I meant was that it doesn't work ON google app engine. Maybe now it works :)
  • Shubham Aggarwal
    Shubham Aggarwal about 8 years
    Could you show me the backend implementation of it or point me to a link? I am doing fb google login on my webapp and now I want to implement it for android