Skip to content

Flask Cloudflare provides additional authorization on top of Cloudfare Access by checking if a user is part of a group

License

Notifications You must be signed in to change notification settings

norrbom/flask_cloudflare_login

Repository files navigation

Flask Cloudflare Login

The Flask Cloudflare Login module provides a Flask-Login user class from Cloudfare Access JWT token and Cloudflare identity API.

Installation

Flask Cloudflare Login is available from PyPI and can be installed by running:

pip install flask-cloudflare-login

Usage example - Dash App

Cloudflare Settings

Configure your Cloudflare settings in in examples/dash/.env

CF_TEAM_DOMAIN=<company>.cloudflareaccess.com
CF_POLICY_AUD=

In order to make the application work locally you need to set CF_TEST_TOKEN with the CF_Authorization cookie value.

CF_TEST_TOKEN=

Start the Dash App

make run

How to contribute?

  • clone this repo or pull the latest changes
  • create a new branch feature/<feature>
  • run make test to auto format code, make sure all tests are passed
  • push the code and create a merge request to main branch
  • get the pull request reviewed and approved, the branch should be removed once merged.
  • create a new git tag version, following semantic versioning praxis MAJOR.MINOR.PATCH

About

Flask Cloudflare provides additional authorization on top of Cloudfare Access by checking if a user is part of a group

Resources

License

Stars

Watchers

Forks

Packages

No packages published