a Flask wrapper which handles OIDC authentication, authorization, and the OAuth flow for a given Identity Provider.
Project description
Easy OIDC Flow
This python library is designed to be an easy drop in which handles OIDC authentication, authorization, and the OAuth flow.
Example Implementation
from flask import Flask, request
from easy_oidc_flow import EasyOIDCFlow
app = EasyOIDCFlow(Flask(__name__))
@app.route("/")
def main():
return f"hello {request.user_data["email"]}!"
if __name__ in "__main__":
app.run(host="0.0.0.0", port=8000, debug=True)
Quickstart
Create a .env file using the .env.template file as a template. Populate with your OAuth Client details (see below)
Run the example server implementation with the following:
uv run --env-file=.env .\example_server.py
IDP Configuration
Google Cloud Platform
- Create a GCP Project
- Navigate to https://console.cloud.google.com/auth/clients/
- Create a Web Application OAuth Client ID
- Download the OAuth client id .json file
- Copy .env to .env.template and fill out the client id and client secret from the downloaded OAuth .json file
- Delete the .json file from your system
Additional Details
This Flask context wrapper overrides the following REST routes:
/login
/callback
So make sure that your flask app doesn't define these routes, or an error will be thrown.
References
https://developers.google.com/identity/openid-connect/openid-connect#discovery
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file easy_oidc_flow-1.0.0.tar.gz.
File metadata
- Download URL: easy_oidc_flow-1.0.0.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.27
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05035f5e3017b49af39200bd1e5566a30d460010d5ec5ad1c8150a34130f60ba
|
|
| MD5 |
10ee91137199d235b82e4b89c7c3f006
|
|
| BLAKE2b-256 |
e066afc820a96ea723f4362284a564ecf17ab41d4b7b79e40b7069963990a231
|
File details
Details for the file easy_oidc_flow-1.0.0-py3-none-any.whl.
File metadata
- Download URL: easy_oidc_flow-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.27
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f42048c1a663438ed0efab00984210c3df143faeadd714ae8447de205f1efb6
|
|
| MD5 |
9f013821b7ef0e79d6f2b97705075e33
|
|
| BLAKE2b-256 |
60e46cb1d4b0afb35b1fb2fcfa21c72ed1d6d113c0a4065a622b66f766246954
|