Skip to main content

Django SAML

Django SAML Authentication Made Easy.

Full documentation for the project is available at https://djangosaml.readthedocs.io/en/latest/.

Python Version

Pypi

Downloads

Requirements

  • Python 3.6+
  • Django 5.0, 4.2, 4.1, 4.0, 3.2, 3.1, 3.0

Installation

xmlsec1 is required by pysaml2:

    apt install xmlsec1
    // or
    yum install xmlsec1
    // or
    brew install xmlsec1

Install using pip...

pip install djangosaml

Add 'djangosaml' to your INSTALLED_APPS setting.

INSTALLED_APPS = [
    ...
    'djangosaml',
]

Now update your root urls.py:

urlpatterns = [
    ...
    path('djangosaml/', include('djangosaml.urls')),
]

Copy your metadata.xml into root directory.

In settings.py, add the SAML2 related configuration.

SAML2_AUTH = {
    # Metadata is required, local file path
    'METADATA_LOCAL_FILE_PATH': BASE_DIR / 'metadata.xml',
    # Populates the Issuer element in authn request
    'ENTITY_ID': 'https://your-domain/djangosaml/acs/',
    # Change Email/UserName/FirstName/LastName to corresponding SAML2 userprofile attributes.
    'ATTRIBUTES_MAP': { 
        'email': '',
        'username': '',
        'first_name': '',
        'last_name': '',
    },
}

In your SAML2 SSO identity provider, set the Single-sign-on URL and Audience URI(SP Entity ID) to:

https://your-domain/djangosaml/acs/

Metadata

Release files for djangosaml 1.0.7

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

Source distribution (sdist)

Source distribution for djangosaml 1.0.7
File Size Uploaded Provenance Actions
djangosaml-1.0.7.tar.gz 7.2 kB Without provenance Details for djangosaml-1.0.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for djangosaml 1.0.7
File Interpreter ABI Platform Actions
djangosaml-1.0.7-py2.py3-none-any.whl Python 3, Python 2 none any Details for djangosaml-1.0.7-py2.py3-none-any.whl

Total release size: 15.0 kB

Release files / djangosaml-1.0.7.tar.gz

Download URL djangosaml-1.0.7.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
aa1baa797add41a25304874aa232779926060000b0faeda0565c8a5734f0f0f5
BLAKE2b-256 checksum
How to use checksums
1be4595f7e27808b3ef86cce772540f6ae7c94eccb27c696654d201ae346c063
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release files / djangosaml-1.0.7-py2.py3-none-any.whl

Download URL djangosaml-1.0.7-py2.py3-none-any.whl
Size 7.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
9ffd65d26ae466b9df050ba6d190c6b6825fb73f38010ea0d993b6b7d3612f89
BLAKE2b-256 checksum
How to use checksums
744585a54af330e37c1dbd8acad28ba9a5b35d20207438a866d576bf87c1db2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Security for djangosaml 1.0.7

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