This repo holds an example Python/Flask application that uses FusionAuth as the identity provider. This application will use an OAuth Authorization Code Grant workflow to log a user in and get them access and refresh tokens.
This application was built by following the Python/Flask Quickstart.
The docker-compose.yml file and the kickstart directory are used to start and configure a local FusionAuth server.
The /complete-application directory contains a fully working version of the application.
- Docker, for running FusionAuth
- Python 3.8 or later, for running the Changebank Python application
To run FusionAuth, just stand up the docker containers using docker-compose.
docker-compose upThis will start a PostgreSQL database, and Elastic service, and the FusionAuth server.
To run the application, first go into the project directory
cd complete-applicationSet up a Python virtual env and installing the project dependencies.
python -m venv venv && \
source venv/bin/activate && \
pip install -r requirements.txtThen use the flask run command to start up the application.
flask --app server.py runIf you're going to be working on the application and want hot reloads of the server code, add the --debug flag.
flask --app server.py --debug runVisit the local webserver at http://localhost:5000/ and sign in using the credentials:
- username: [email protected]
- password: password