Metadata-Version: 2.1
Name: djangosaml
Version: 1.0.7
Summary: Django SAML2 Authentication Made Easy. Easily integrate with SAML2 SSO identity providers like Okta
Home-page: https://djangosaml.readthedocs.io/en/latest/
Author: Fang Li
Author-email: lorenzo.gil.sanchez@gmail.com
License: Apache 2.0
Keywords: Django SAML2 Authentication Made Easy,integrate with SAML2 SSO such as Okta easily
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Framework :: Django :: 4.2
Classifier: Framework :: Django :: 5.0
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: AUTHORS.rst
Requires-Dist: pysaml2>=4.5.0

# [Django SAML][docs]


**Django SAML Authentication Made Easy.**

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

[![Python Version](https://img.shields.io/pypi/pyversions/djangosaml.svg)](https://pypi.python.org/pypi/djangosaml)

[![Pypi](https://img.shields.io/pypi/v/djangosaml.svg)](https://pypi.python.org/pypi/djangosaml)

[![Downloads](https://img.shields.io/pypi/dm/djangosaml.svg)](https://pypi.python.org/pypi/djangosaml)


## 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.
```python
INSTALLED_APPS = [
    ...
    'djangosaml',
]
```

Now update your root `urls.py`:

```python
urlpatterns = [
    ...
    path('djangosaml/', include('djangosaml.urls')),
]
```
Copy your `metadata.xml` into root directory.

In `settings.py`, add the SAML2 related configuration.

```python
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/
```



[docs]: https://djangosaml.readthedocs.io/en/latest/
