Skip to main content

Python (Flask)

Setup

Install pipenv

This app uses pipenv. Follow these instructions to install it.

Clone the server

Start by cloning the server repository from GitHub. You can do this by running the following command:

git clone https://github.com/aserto-demo/todo-python-v2

Install dependencies

To install the application dependencies, run the following command:

cd todo-python-v2
pipenv install

Set up the .env file

Copy the .env.example file to .env and update the ASERTO_AUTHORIZER_CERT_PATH and ASERTO_DIRECTORY_GRPC_CERT_PATH to correspond to the path in which Topaz generated your certificates (by default this path will be $HOME/.config/topaz/certs/grpc-ca.crt).

cp .env.example .env

Your .env file should look like:

JWKS_URI=https://citadel.demo.aserto.com/dex/keys
ISSUER=https://citadel.demo.aserto.com/dex
AUDIENCE=citadel-app

ASERTO_POLICY_ROOT="todoApp"

ASERTO_AUTHORIZER_SERVICE_URL=localhost:8282
ASERTO_AUTHORIZER_CERT_PATH=$HOME/.config/topaz/certs/grpc-ca.crt
ASERTO_DIRECTORY_SERVICE_URL=localhost:9292
ASERTO_DIRECTORY_GRPC_CERT_PATH=$HOME/.config/topaz/certs/grpc-ca.crt

Start the server

pipenv run flask run

Next steps

Test your server by using the sample web Todo application.