This project is a simple Python web application demonstrating OpenID Connect (OIDC) integration, token handling, and browser automation with Playwright.
- Install dependencies:
- Create and activate a virtual environment
- Run
pip install -r requirements.txt
- Install Playwright browsers:
- Run
make playwright-installorpython -m playwright install --with-deps
- Run
- Set the required environment variables.
Set these before running the application (in your shell, Docker, or docker-compose):
CLIENT_ID— Your OIDC client IDCLIENT_SECRET— Your OIDC client secretAUTH_USERNAME- Your username at the authorization serverAUTH_PASSWORD- Your password at the authorization serverISSUER_URL— OIDC issuer base URL (e.g.,https://auth.example.com)REDIRECT_URI— Redirect URI registered with the authorization server (e.g.,http://localhost:5000/auth/callback)
Example:
export CLIENT_ID=your_client_id
export CLIENT_SECRET=your_client_secret
export AUTH_USERNAME=your_username
export AUTH_PASSWORD=your_password
export ISSUER_URL=https://auth.example.com
export REDIRECT_URI=http://localhost:5000/auth/callback- Start the app locally:
python app.py
- Or with Docker Compose:
make up
- Format code:
make fmt - Lint code:
make lint
- Playwright browsers must be installed before running browser automation.
- All secrets should be set via environment variables.
- The authentication flow is tailored to a Keycloak authorization server.