Skip to main content

Django Federated Login

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.

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'

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/'

urls.py:
from federated_login import patch_admin

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.

Metadata

Release files for django-federated-login 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-federated-login 0.4.0
File Size Uploaded Provenance Actions
django-federated-login-0.4.0.tar.gz 10.2 kB Without provenance Details for django-federated-login-0.4.0.tar.gz

Release files / django-federated-login-0.4.0.tar.gz

Download URL django-federated-login-0.4.0.tar.gz
Size 10.2 kB
Tags Source
SHA-256 checksum
How to use checksums
bccadd1affc338a0a7f97ecf94d2596831c8ad230710283e43ad21aa12fd4dc9
BLAKE2b-256 checksum
How to use checksums
1ff4b876f093cd5f56b5c54c8e72a797c12502b52b20ef5bf0a15ee13c89ed79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-federated-login 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page