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.
Metadata
Release files for pursuitlib-sso 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pursuitlib-sso-0.2.0.tar.gz | 6.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pursuitlib_sso-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.1 kB
Release files / pursuitlib-sso-0.2.0.tar.gz
| Download URL | pursuitlib-sso-0.2.0.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
97c3f7c578eea8aad84a24391efffb01fc93fd8714243a1410e7237d76da6a16
|
|
BLAKE2b-256 checksum How to use checksums |
aec653e78c9aa9ef75cf8ad5fc2413755b87b2242a1dfc6b4b7dc9bdd4e9d65b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / pursuitlib_sso-0.2.0-py3-none-any.whl
| Download URL | pursuitlib_sso-0.2.0-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
49121ab92f6894336f9a48ddfed3fbdf62d4e8d2a46e557bf5d5ad2619a39a8a
|
|
BLAKE2b-256 checksum How to use checksums |
09d5761a5a556874a52abe51ec5600254cf21a290f2563ea613ed6dd4e933c0e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|