Provides SSO functions for Django
Project description
Pursuit Library - SSO
This package provides SSO functions for Django.
Configuration
Create a SSO_CONFIG object in your settings.py:
SSO_CONFIG = {
"saml2": {
"entityid": "saml_entity_id",
"organization": {
"name": "organization_name",
"verbose_name": "Organization Name"
},
"contacts": [
{
"name": "Contact 1",
"email": "contact1@mydomain.com"
}
],
"idp": [
{
"id": "idp_id",
"entity": "idp_entity_id",
"metadata": "https://url/to/idp/metadata.xml",
"debug_identity": {
"email": "user@example.com",
"first_name": "John",
"last_name": "Doe"
}
}
]
},
"default_redirect": "home:index",
"get_or_create_user": get_or_create_user
}
The get_or_create_user finds an existing user or create a new one based on the IDP's response:
def get_or_create_user(idp: str, user_data) -> User:
get_user_from_db(user_data)
Debugging
When debugging on a local machine, you can define SSO_DEBUG = True in your settings.py to bypass the remote IDP, and instead use the debug_identity object.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pursuitlib-sso-0.2.0.tar.gz.
File metadata
- Download URL: pursuitlib-sso-0.2.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97c3f7c578eea8aad84a24391efffb01fc93fd8714243a1410e7237d76da6a16
|
|
| MD5 |
24fe909e08786ac8214e41ae0bbdbd69
|
|
| BLAKE2b-256 |
aec653e78c9aa9ef75cf8ad5fc2413755b87b2242a1dfc6b4b7dc9bdd4e9d65b
|
File details
Details for the file pursuitlib_sso-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pursuitlib_sso-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49121ab92f6894336f9a48ddfed3fbdf62d4e8d2a46e557bf5d5ad2619a39a8a
|
|
| MD5 |
bac41b6ae53e606636ac7c59945250b1
|
|
| BLAKE2b-256 |
09d5761a5a556874a52abe51ec5600254cf21a290f2563ea613ed6dd4e933c0e
|