# [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/1b/e4/595f7e27808b3ef86cce772540f6ae7c94eccb27c696654d201ae346c063/djangosaml-1.0.7.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.7",
"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": "744585a54af330e37c1dbd8acad28ba9a5b35d20207438a866d576bf87c1db2e",
"md5": "f8c010852f0a36cb63d33be67b46d0d4",
"sha256": "9ffd65d26ae466b9df050ba6d190c6b6825fb73f38010ea0d993b6b7d3612f89"
},
"downloads": -1,
"filename": "djangosaml-1.0.7-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "f8c010852f0a36cb63d33be67b46d0d4",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 7809,
"upload_time": "2024-08-26T07:25:37",
"upload_time_iso_8601": "2024-08-26T07:25:37.868670Z",
"url": "https://files.pythonhosted.org/packages/74/45/85a54af330e37c1dbd8acad28ba9a5b35d20207438a866d576bf87c1db2e/djangosaml-1.0.7-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1be4595f7e27808b3ef86cce772540f6ae7c94eccb27c696654d201ae346c063",
"md5": "c1af07d4058c97df4d610758cfa7602a",
"sha256": "aa1baa797add41a25304874aa232779926060000b0faeda0565c8a5734f0f0f5"
},
"downloads": -1,
"filename": "djangosaml-1.0.7.tar.gz",
"has_sig": false,
"md5_digest": "c1af07d4058c97df4d610758cfa7602a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7230,
"upload_time": "2024-08-26T07:25:42",
"upload_time_iso_8601": "2024-08-26T07:25:42.287779Z",
"url": "https://files.pythonhosted.org/packages/1b/e4/595f7e27808b3ef86cce772540f6ae7c94eccb27c696654d201ae346c063/djangosaml-1.0.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-26 07:25:42",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "djangosaml"
}