Django Federated Login provides an authentication bridge between Django projects and OpenID-enabled identity providers.

Related tags

Djangodjangossoopenid
Overview

Django Federated Login

Build Status Test Coverage PyPI

Django Federated Login provides an authentication bridge between Django projects and OpenID-enabled identity providers. The bridge is pre-wired to be used with a single Google Apps domain, but could be extended to be linked with other OpenID providers also. It is different from other OpenID consumers as this consumer only allows connecting to a pre-defined identity provider.

The provided backend matches users based on the e-mail address returned from the identity provider. If no matching user could be found, a user account can optionally be created.

I would love to hear your feedback on this package. If you run into problems, please file an issue on GitHub, or contribute to the project by forking the repository and sending some pull requests.

Compatible with Django 1.4, 1.5 and 1.6 on Python 2.6, 2.7, 3.2 and 3.3. Python 3 is supported through the python3-openid fork.

Installation

Installation with pip:

$ pip install django-federated-login

Add 'federated_login.auth_backend.EmailBackend' as authentication backend:

settings.py:
AUTHENTICATION_BACKENDS = (
    'federated_login.auth_backends.EmailBackend',
    'django.contrib.auth.backends.ModelBackend',
)

Add 'federated_login' as installed app:

settings.py:
INSTALLED_APPS = (
    ...
    'federated_login',
)

Provide the Google Apps domain to identify against:

settings.py:
FL_APPS_DOMAIN = 'webatoom.nl'

For Django 1.6, need to configure session serializer:

settings.py:
SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'

Register the views:

urls.py:
url(r'^federated/', include('federated_login.urls')),

Sync or migrate your database:

python manage.py syncdb
# or if you use South:
python manage.py migrate federated_login

Usage

Point your browser to /federated/login/. You might want to include a button to this url on the regular login page. You could also use the federated login page as the default login page, replacing the username and password login pages. To do this, configure the LOGIN_ settings:

settings.py:
LOGIN_REDIRECT_URL = '/'
LOGIN_URL = '/federated/login/'

Settings

These are the customizable settings:

FL_APPS_DOMAIN
Google Apps domain to identify against. Can be overriden by FL_SSO_ENDPOINT.
FL_USER_FACTORY (Default: 'federated_login.user_factories.normal')
Function that is called when creating a user account. Set to None to disable creation of new users. There is also 'federated_login.user_factories.staff' that creates staff users and 'federated_login.user_factories.superuser' that creates superusers.
FL_SSO_ENDPOINT (Default: Google Apps)
Override this setting to link with another OpenID identity provider. The FL_APPS_DOMAIN setting will have no effect when providing a custom FL_SSO_ENDPOINT.
FL_USER_CLASS (Default: 'django.contrib.auth.models.User')
Django model class to used to create and query for users.
FL_PATCH_ADMIN (Default: True)
Django's admin site is automatically patched to use federated login. Set this setting to False to disable this feature. You can call federated_login.admin.patch_admin() and federated_login.admin.unpatch_admin() to respectively patch and unpatch the admin site.
Owner
Bouke Haarsma
Bouke Haarsma
Domain-driven e-commerce for Django

Domain-driven e-commerce for Django Oscar is an e-commerce framework for Django designed for building domain-driven sites. It is structured such that

Oscar 5.6k Jan 01, 2023
Transparently use webpack with django

Looking for maintainers This repository is unmaintained as I don't have any free time to dedicate to this effort. If you or your organisation are heav

Owais Lone 2.4k Jan 06, 2023
Auto-detecting the n+1 queries problem in Python

nplusone nplusone is a library for detecting the n+1 queries problem in Python ORMs, including SQLAlchemy, Peewee, and the Django ORM. The Problem Man

Joshua Carp 837 Dec 29, 2022
Automated image processing for Django. Currently v4.0

ImageKit is a Django app for processing images. Need a thumbnail? A black-and-white version of a user-uploaded image? ImageKit will make them for you.

Matthew Dapena-Tretter 2.1k Dec 17, 2022
Indonesia's negative news detection using gaussian naive bayes with Django+Scikir Learn

Introduction Indonesia's negative news detection using gaussian naive bayes build with Django and Scikit Learn. There is also any features, are: Input

Harifzi Ham 1 Dec 30, 2021
Django based webapp pulling in crypto news and price data via api

Deploy Django in Production FTA project implementing containerization of Django Web Framework into Docker to be placed into Azure Container Services a

0 Sep 21, 2022
Official Python agent for the Elastic APM

elastic-apm -- Elastic APM agent for Python This is the official Python module for Elastic APM. It provides full out-of-the-box support for many of th

elastic 369 Jan 05, 2023
Django-MySQL extends Django's built-in MySQL and MariaDB support their specific features not available on other databases.

Django-MySQL The dolphin-pony - proof that cute + cute = double cute. Django-MySQL extends Django's built-in MySQL and MariaDB support their specific

Adam Johnson 504 Jan 04, 2023
Buckshot++ is a new algorithm that finds highly stable clusters efficiently.

Buckshot++: An Outlier-Resistant and Scalable Clustering Algorithm. (Inspired by the Buckshot Algorithm.) Here, we introduce a new algorithm, which we

John Jung 1 Jul 02, 2022
Django Course Project - TextCorrector

Django-TextUtils Django Course Project A tool for analyzing text data in Django backend. It is a project where you can do some of the things with you

1 Oct 29, 2021
A clone of https://virgool.io written in django

Virgool clone A clone of virgool blog written in django Installation first rename the .env.sample to .env and fill it. with docker docker-compose up -

Danial Selmipoor 7 Dec 23, 2022
GeoDjango provides geospatial extensions to the Django web dev framework

Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. All documentation is in the "docs" directo

Paul Smith 20 Sep 20, 2022
Django Simple Spam Blocker is blocking spam by regular expression.

Django Simple Spam Blocker is blocking spam by regular expression.

Masahiko Okada 23 Nov 29, 2022
A simple Blog Using Django Framework and Used IBM Cloud Services for Text Analysis and Text to Speech

ElhamBlog Cloud Computing Course first assignment. A simple Blog Using Django Framework and Used IBM Cloud Services for Text Analysis and Text to Spee

Elham Razi 5 Dec 06, 2022
☄️ Google Forms autofill script

lazrr 'Destroy Them With Lazers' - Knife Party, 2011 Google Forms autofill script Installation: pip3 install -r requirements.txt Usage: python3 lazrr.

Serezha Rakhmanov 12 Jun 04, 2022
Service request portal on top of Ansible Tower

Squest - A service request portal based on Ansible Tower Squest is a Web portal that allow to expose Tower based automation as a service. If you want

Hewlett Packard Enterprise 183 Jan 04, 2023
Twitter-clone using Django (DRF) + VueJS

Twitter Clone work in progress 🚧 A Twitter clone project Table Of Contents About the Project Built With Getting Started Running project License Autho

Ahmad Alwi 8 Sep 08, 2022
based official code from django channels, replace frontend with reactjs

django_channels_chat_official_tutorial demo project for django channels tutorial code from tutorial page: https://channels.readthedocs.io/en/stable/tu

lightsong 1 Oct 22, 2021
Show how the redis works with Python (Django).

Redis Leaderboard Python (Django) Show how the redis works with Python (Django). Try it out deploying on Heroku (See notes: How to run on Google Cloud

Tom Xu 4 Nov 16, 2021
Automatically deletes old file for FileField and ImageField. It also deletes files on models instance deletion.

Django Cleanup Features The django-cleanup app automatically deletes files for FileField, ImageField and subclasses. When a FileField's value is chang

Ilya Shalyapin 838 Dec 30, 2022