Skip to main content

ADFS oAuth provider for django-allauth

Project description


.. image::

.. image::

.. image::

.. image::


apt-get update && apt-get install -y libffi-dev libssl-dev

pip install django-allauth-adfs django-allauth-adfs[jwt] django-allauth-adfs[pki]

if you want to enforce staff users to log in via adfs
add allauth_adfs to installed apps and set
SOCIALACCOUNT_ADAPTER = "allauth_adfs.socialaccount.adapter.SocialAccountAdapter"

if you want to return different django user instances per SocialApp from the provider
use utils.per_social_app_extract_uid_handler instead of the default_extract_uid_handler
this can be useful for permissions handling in multi tenant configurations
and utils.per_social_app_extract_common_fields_handler for the username to be based
on app id. it uses base64 guid and app id.

if you want the admin to use this auth then you do the following:

then somewhere in for an app

from django.contrib.auth.decorators import login_required
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib import admin


# monkey patch admin login view to redirect to the site login view = login_required(
staff_member_required(, login_url="permission-denied-change-user")

the "permission-denied-change-user" view is just a view that presents a message via the messages framework
to the user about why they are being redirected and then redirects to the sign out view.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-allauth-adfs, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size (13.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page