Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flasksaml-0.2.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

flasksaml-0.2.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file flasksaml-0.2.0.tar.gz.

File metadata

  • Download URL: flasksaml-0.2.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

Hashes for flasksaml-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b530b6f2ca39a87a8865916222a7468252c1e20ef7f5af000b008b7bc5bb0ae9
MD5 3b22810cb87f9194da4dd8cfdfa299cb
BLAKE2b-256 3ada9b9d2d983d92fcb973cbccc3695e43c1799a421436933a4f4368ec4c10df

See more details on using hashes here.

File details

Details for the file flasksaml-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: flasksaml-0.2.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

Hashes for flasksaml-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8230429a1b8808a2fb3b8f4b9739bd1e040192f98bd355cd5d78680b3fb0dd95
MD5 65e11911ec2a381c1fb33f80ef1caae3
BLAKE2b-256 bcb2ec835de34819cab432e7ea1e50d6800d4a77562a4288501f2e74eec222c7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page