Skip to main content

A database-backed django-auth-adfs settings class

Project description

1 Welcome to django-auth-adfs-db’s documentation!

Version:

0.1.1

Source:

https://github.com/isprojects/django-auth-adfs-db

Keywords:

ADFS, Django, database, authentication backend

PythonVersion:

3.7

build-status Coverage status

python-versions django-versions pypi-version

A database-backed django-auth-adfs settings class

2 Features

  • Thin layer on top of django-auth-adfs

  • SAAS ready: store ADFS configuration in a database singleton

  • Quick toggle to enable/disable ADFS based auth

  • Hooks into Django’s auth machinery

Django-auth-adfs-db provides a setting class reading out the dynamic ADFS configuration. This moves the ADFS configuration from deploy-time to run-time, and SAAS clients can configure their ADFS integration themselves. No more server reloads of deployment environment variable changes needed!

3 Installation

3.1 Requirements

  • Python 3.6 or higher

  • setuptools 30.3.0 or higher

  • Django 2.1 or higher

  • PostgreSQL (with jsonb field)

3.2 Install

pip install django-auth-adfs-db

This will also install the django-auth-adfs and django-solo packages.

3.3 Django settings

Make sure the following libraries are added to your INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    "django_auth_adfs"
    "django_auth_adfs_db"
    "solo",
    ...
]

Add django_auth_adfs_db.backends.AdfsAuthCodeBackend to AUTHENTICATION_BACKENDS.

Ensure that LOGIN_URL and LOGIN_REDIRECT_URL are configured. You can set:

LOGIN_URL = reverse_lazy("django_auth_adfs:login")
LOGIN_REDIRECT_URL = "/"

if you wish to make ADFS your primary auth login.

Set the AUTH_ADFS config class:

AUTH_ADFS = {"SETTINGS_CLASS": "django_auth_adfs_db.settings.Settings"}

or a subclass thereof.

Finally, register the URLs in your root config with:

urlpatterns += [path("oauth2/", include("django_auth_adfs.urls")),]

3.4 ADFS login URL on admin login

Template: admin/login.html

{% extends "admin/login.html" %}
{% load solo_tags i18n %}


{% block content %}
{{ block.super }}

{% get_solo 'openzaak_auth.ADFSConfig' as adfs_config %}
{% if adfs_config.enabled %}
<div class="submit-row">
    <a href="{% url 'django_auth_adfs:login' %}">{% trans "Login with ADFS" %}</a>
</div>
{% endif %}
{% endblock %}

4 Usage

You can now configure the ADFS settings in the Django admin.

Please follow the django-auth-adfs documentation for advanced usage.

Project details


Download files

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

Source Distribution

django-auth-adfs-db-0.1.1.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

django_auth_adfs_db-0.1.1-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file django-auth-adfs-db-0.1.1.tar.gz.

File metadata

  • Download URL: django-auth-adfs-db-0.1.1.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for django-auth-adfs-db-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4c4933b1b11703c8af9b397623ba0f5ef47dbc51c618eb4554e71fe7a5e7d097
MD5 663b1e7d6012d0cc20e86d64d8be011f
BLAKE2b-256 3d95f28d380d58ddeb5c8efb418f4836896e6c0aa5f55bdbc6e942393a6673de

See more details on using hashes here.

File details

Details for the file django_auth_adfs_db-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: django_auth_adfs_db-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for django_auth_adfs_db-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b13f8064715cee973f7bee9599c819b92aecd9695f17c6066e9733193b3c9f1a
MD5 a6884f14ae061433dbb99ffc665be245
BLAKE2b-256 7ac1da729a447708ff983dbb0aff9b70ea45200bd8ab17c92820d542cddc1824

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page