A Flask wrapper that implements SAML Service Provider functionalities
Project description
Flask SAML
A Flask wrapper that implements SAML Service Provider (SP) functionalities. A marriage between Flask and python3-saml.
Installation
pip install flasksaml
Usage
Set SAML parameters
For SAML SSO to work, you need to set certain parameters, particularly regarding the SAML SP & IdP. These
definitions are set in settings.json
and advanced_settings.json
. For more information, please consult
the documentation of python3-saml.
After you configured settings.json
& advanced_settings.json
, set the location of the directory
containing those 2 files in the FLASK_SAML_SETTINGS_PATH
environment variable.
Create Flask App
Create your Flask application using the FlaskSAML class as such:
from flasksaml import FlaskSAML
app = FlaskSAML(__name__)
# Set a cryptographically secure secret key. This secret key is used to sign session cookies. Failure to
# to do so might enable tampering of session cookies
# https://flask.palletsprojects.com/en/1.1.x/config/?highlight=secret_key#SECRET_KEY
app.config["SECRET_KEY"] = "so-so-secret"
Environment Variables
# Comma-separated string of URL paths that should not require authentication
# Default: "status,healthcheck,health"
FLASK_SAML_WHITELISTED_ENDPOINTS: "status,healthcheck,health"
# The location of directory containing settings.json & advanced_settings.json
# Defaults to current working directory
FLASK_SAML_SETTINGS_PATH: ""
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
File details
Details for the file flasksaml-0.1.0.tar.gz
.
File metadata
- Download URL: flasksaml-0.1.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.6.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86e9808d76151ad7201bf227d39aa4272e1280061b514b6c2a892a300aeb74f9 |
|
MD5 | 2f99d1c2e3655eec54a9c3eff60909af |
|
BLAKE2b-256 | be557a8385d5269eb271343fcbf0a609b6a0f3d87b8e3d954bfee740ec90257b |
File details
Details for the file flasksaml-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: flasksaml-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.6.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0415606432ac92199709d7ddcef8c432ebceba663537c08aee4ef6557429894e |
|
MD5 | d7bffefa75d6424001812aec0bc350dc |
|
BLAKE2b-256 | 54e3b343774d851faa865411fe2a4f855aba27bea05776605c40005799edd403 |