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
pursuitlib-sso-0.2.0.tar.gz
(6.1 kB
view hashes)
Built Distribution
Close
Hashes for pursuitlib_sso-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49121ab92f6894336f9a48ddfed3fbdf62d4e8d2a46e557bf5d5ad2619a39a8a |
|
MD5 | bac41b6ae53e606636ac7c59945250b1 |
|
BLAKE2b-256 | 09d5761a5a556874a52abe51ec5600254cf21a290f2563ea613ed6dd4e933c0e |