Skip to main content
https://badge.fury.io/py/django-auth-oidc.svg

This is a Django login view that authenticates against an OpenID Connect Authentication Server.

Use it if you own a single Authentication Server that you want to share between multiple apps.

What is OpenID Connect?

It’s a OAuth2-based standard for authentication in applications.

It can be used for social logins (but we recommend Aiakos if you need more than one), and for setting up Single Sign-On into multiple services hosted by the same company. In the last case, it somewhat supersedes LDAP, as with OIDC people are entering their credentials only into the views served by the Authentication Server, and not into all the company’s applications.

Requirements

Installation

pip install django-auth-oidc

settings.py

INSTALLED_APPS += ['django_auth_oidc']

urls.py

urlpatterns += [
        url(r'^auth/', include('django_auth_oidc.urls')),
]

Configuration

Authorization Server

App’s redirect URI: http(s)://app-domain/auth/done App’s post-logout redirect URI: http(s)://app-domain/LOGOUT_REDIRECT_URL (or / if not set)

Authorization Server details

You may specify following settings in the Django settings file:

  • AUTH_SERVER - OpenID Connect Authorization Server URL.

  • AUTH_CLIENT_ID - Client ID received from the Authorization Server

  • AUTH_CLIENT_SECRET - Client secret received from the Authorization Server

  • AUTH_PROTOCOL (optional) - Legacy protocol supported by openid-connect library, for example github or gitlab. See openid-connect’s documentation for full list of supported protocols.

Or, alternatively, you may set the AUTH_URL environment variable:

AUTH_URL=(protocol+)http(s)://client_id:client_secret@server/

(Note: “:”, “@”, “/” and “%” inside client_id and client_secret must be urlquoted.)

Behavior

  • AUTH_SCOPE (default: [‘openid’]) - list of scopes to request from the auth server

  • AUTH_GET_USER_FUNCTION (default: ‘django_auth_oidc:get_user_by_username’) - name of a function that takes the user info dict, and returns an user object representing that user; note that it should set the user.backend attribute.

Release files for django-auth-oidc 0.6.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-auth-oidc 0.6.0
File Size Uploaded
django-auth-oidc-0.6.0.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-auth-oidc 0.6.0
File Interpreter ABI Platform
django_auth_oidc-0.6.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 12.1 kB

Release files / django-auth-oidc-0.6.0.tar.gz

Download URL django-auth-oidc-0.6.0.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d6457dd9f253da12feac5639bbb87f7b2a0bd2a3749fdd8c827560456a865b2b
BLAKE2b-256 checksum
How to use checksums
1c990860e90288873804d74d49fbea0d97ff8d00961f0271396ec35b7fac95b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

Release files / django_auth_oidc-0.6.0-py2.py3-none-any.whl

Download URL django_auth_oidc-0.6.0-py2.py3-none-any.whl
Size 6.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
3788b5c582c1d4aa5efa1d74a93e6effafca8630605661a40caaa085886fa023
BLAKE2b-256 checksum
How to use checksums
d14a681eda9f7ac2694b47648c440c097bf97cfa3ee64b559809ed4eb090ec5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.0

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

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