Flask OIDC Verifier
Implements implicit OIDC verification for Flask, similar to drf-oidc-auth in Django.
Quickstart
Assumptions: tokens are passed via headers of the form Authorization: Bearer $YOUR_TOKEN. These can be changed in the settings
- Install with
pip install flask-oidc-verifier - Add the following to your flask config (at a minimum, see the Config section for more options). Replace the values with relevant config values:
class Config():
...
OIDC_ENDPOINT = "https://my.oidc.endpoint"
OIDC_AUDIENCES = ("MY_AUDIENCES", )
...
- Initialize the authentication provider:
from flask import Flask
from flask_oidc_verifier.decorators import JWTVerification
from typing import Dict, Any
app = Flask(__name__)
# Define a callback for what to do with the verified JWT contents
def on_verified(d: Dict[Any, Any]) -> None:
# get_or_create_user
...
auth = auth.init_app(app, on_verified=on_verified)
- Use as a decorator:
@app.route("/protected/<path:filename>")
@auth.jwt_required
def protected_file(filename: str) -> None:
return send_from_directory("protected", filename)
Config
TODO
Metadata
Release files for flask-oidc-verifier 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| flask_oidc_verifier-0.0.8.tar.gz | 6.1 kB | Without provenance | Details for flask_oidc_verifier-0.0.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| flask_oidc_verifier-0.0.8-py3-none-any.whl | Python 3 | none | any | Details for flask_oidc_verifier-0.0.8-py3-none-any.whl |
Total release size: 14.5 kB
Release files / flask_oidc_verifier-0.0.8.tar.gz
| Download URL | flask_oidc_verifier-0.0.8.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6a0613a5074be7eb6c6fde6457c8f193c23920697d12e90b1a66e707c780065f
|
|
BLAKE2b-256 checksum How to use checksums |
6bf04cc57be71130cc65820deb7b806a02a366793018ec06c47ff136cc280222
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
|
Release files / flask_oidc_verifier-0.0.8-py3-none-any.whl
| Download URL | flask_oidc_verifier-0.0.8-py3-none-any.whl |
|---|---|
| Size | 8.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fe0f2bdb75effa5d7e75c43735d6089747dc4930f1314b3ffe6868ea0d399708
|
|
BLAKE2b-256 checksum How to use checksums |
66b5297501f0a6512ef36509950b62f715bec4e09334dd568de77c0ef9c77282
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
|
Security for flask-oidc-verifier 0.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.