# [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/
Raw data
{
"_id": null,
"home_page": "https://djangosaml.readthedocs.io/en/latest/",
"name": "djangosaml",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "Django SAML2 Authentication Made Easy, integrate with SAML2 SSO such as Okta easily",
"author": "Fang Li",
"author_email": "lorenzo.gil.sanchez@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/68/b7/880d02d13ecf23b0f003567c42b7d9a88ba12c084ef91452c6d6defa862d/djangosaml-1.0.3.tar.gz",
"platform": null,
"description": "# [Django SAML][docs]\n\n\n**Django SAML Authentication Made Easy.**\n\nFull documentation for the project is available at [https://djangosaml.readthedocs.io/en/latest/][docs].\n\n[![Python Version](https://img.shields.io/pypi/pyversions/djangosaml.svg)](https://pypi.python.org/pypi/djangosaml)\n\n[![Pypi](https://img.shields.io/pypi/v/djangosaml.svg)](https://pypi.python.org/pypi/djangosaml)\n\n[![Downloads](https://img.shields.io/pypi/dm/djangosaml.svg)](https://pypi.python.org/pypi/djangosaml)\n\n\n## Requirements\n\n* Python 3.6+\n* Django 5.0, 4.2, 4.1, 4.0, 3.2, 3.1, 3.0\n\n\n\n## Installation\n`xmlsec1` is required by pysaml2:\n```\n apt install xmlsec1\n // or\n yum install xmlsec1\n // or\n brew install xmlsec1\n```\n\nInstall using `pip`...\n\n pip install djangosaml\n\nAdd `'djangosaml'` to your `INSTALLED_APPS` setting.\n```python\nINSTALLED_APPS = [\n ...\n 'djangosaml',\n]\n```\n\nNow update your root `urls.py`:\n\n```python\nurlpatterns = [\n ...\n path('djangosaml/', include('djangosaml.urls')),\n]\n```\nCopy your `metadata.xml` into root directory.\n\nIn `settings.py`, add the SAML2 related configuration.\n\n```python\nSAML2_AUTH = {\n # Metadata is required, local file path\n 'METADATA_LOCAL_FILE_PATH': BASE_DIR / 'metadata.xml',\n # Populates the Issuer element in authn request\n 'ENTITY_ID': 'https://your-domain/djangosaml/acs/',\n # Change Email/UserName/FirstName/LastName to corresponding SAML2 userprofile attributes.\n 'ATTRIBUTES_MAP': { \n 'email': '',\n 'username': '',\n 'first_name': '',\n 'last_name': '',\n },\n}\n\n```\n\nIn your SAML2 SSO identity provider, set the Single-sign-on URL and Audience URI(SP Entity ID) to:\n\n```\nhttps://your-domain/djangosaml/acs/\n```\n\n\n\n[docs]: https://djangosaml.readthedocs.io/en/latest/\n",
"bugtrack_url": null,
"license": "Apache 2.0",
"summary": "Django SAML2 Authentication Made Easy. Easily integrate with SAML2 SSO identity providers like Okta",
"version": "1.0.3",
"project_urls": {
"Homepage": "https://djangosaml.readthedocs.io/en/latest/"
},
"split_keywords": [
"django saml2 authentication made easy",
" integrate with saml2 sso such as okta easily"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "28b6fe30d9b1a10d4796da48ebed5b6fdfc3582434f8dbddede06af5f696944b",
"md5": "cd8db6eb9000bc16377ca6eaabe08259",
"sha256": "da6bbcd0185457850e6ed669957f8cba22e520b45958a32bd820a82529fee83b"
},
"downloads": -1,
"filename": "djangosaml-1.0.3-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "cd8db6eb9000bc16377ca6eaabe08259",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 7327,
"upload_time": "2024-04-03T09:10:30",
"upload_time_iso_8601": "2024-04-03T09:10:30.873964Z",
"url": "https://files.pythonhosted.org/packages/28/b6/fe30d9b1a10d4796da48ebed5b6fdfc3582434f8dbddede06af5f696944b/djangosaml-1.0.3-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "68b7880d02d13ecf23b0f003567c42b7d9a88ba12c084ef91452c6d6defa862d",
"md5": "af4d9389c7212fe11113108c772c13a2",
"sha256": "88a255c886b5a1e0e1858bd15169a9641f1c5101d70219c435ec16761ce491f4"
},
"downloads": -1,
"filename": "djangosaml-1.0.3.tar.gz",
"has_sig": false,
"md5_digest": "af4d9389c7212fe11113108c772c13a2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 6749,
"upload_time": "2024-04-03T09:10:32",
"upload_time_iso_8601": "2024-04-03T09:10:32.637469Z",
"url": "https://files.pythonhosted.org/packages/68/b7/880d02d13ecf23b0f003567c42b7d9a88ba12c084ef91452c6d6defa862d/djangosaml-1.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-03 09:10:32",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "djangosaml"
}