A Django authentication backend for Microsoft ADFS
Project description
A Django authentication backend for Microsoft ADFS
Free software: BSD License
Documentation: http://django-auth-adfs.readthedocs.org/
Features
Let’s your django users login through Microsoft ADFS by using OAuth2.
Provides seamless single sign-on on intranet environments.
Automatically creates users upon receiving a valid access token from ADFS.
Adds users to groups upon signin
Installation
Python package:
pip install django-auth-adfs
In your project’s settings.py
AUTHENTICATION_BACKENDS = (
...
'django_auth_adfs.backend.AdfsBackend',
...
)
INSTALLED_APPS = (
...
# Needed for the redirect URL to function
'django_auth_adfs',
...
AUTH_ADFS = {
"ADFS_SERVER": "adfs.yourcompany.com",
"ADFS_CLIENT_ID": "your-configured-client-id",
"ADFS_RESOURCE": "your-adfs-RPT-name",
"ADFS_SIGNING_CERT": "/path/to/adfs-signing-certificate.pem",
"ADFS_AUDIENCE": "microsoft:identityserver:your-adfs-RPT-name",
"ADFS_ISSUER": "http://adfs.yourcompany.com/adfs/services/trust",
"ADFS_CA_BUNDLE": "/path/to/ca-bundle.pem",
"ADFS_CLAIM_MAPPING": {"first_name": "given_name",
"last_name": "family_name",
"email": "email"},
}
In your project’s urls.py
urlpatterns = [
...
# Needed for the redirect URL to function
url(r'^oauth2/', include('django_auth_adfs.urls', namespace='auth_adfs')),
...
]
The URL you have to configure as the redirect URL in ADFS depends on the url pattern you configure. In the example above you have to make the redirect url in ADFS point to https://yoursite.com/oauth2/login
Contributing
Contributions to the code are more then welcome. For more details have a look at the CONTRIBUTION.rst file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django_auth_adfs-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e13a09f7db836e6d838201c86dd00f1c641dbd1e5815c25e9dcf5672277ea650 |
|
MD5 | eec48189ec6b00e36e3e3a1d736a149f |
|
BLAKE2b-256 | fab8563522bf4dc8ce4dd3c452b75656628451f0540876a4111c304e82ac4071 |