Example to use FastAPI with Authomatic (OAuth2) and add Authorization for this Github organization.
Precondition: Python 3.11
Then run Make - it creates a venv
, no worries:
make install
./venv/bin/eccpilot_authomatic_example
For debugging/developing:
ECCPILOT_DEBUG=1 ./venv/bin/uvicorn --host 0.0.0.0 eccpilot_authomatic_example.main:app --reload
In the browser of the machine running the service, go to http://local.kleinundpartner.at:8000/login/github (the domain points to localhost).
You are redirected to Github. Accepts there and then you get a message if you are logged in or not allowed (if you are not in this ECC-Pilot organization).