Skip to content

remcojansen/python-oidc-integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python OIDC Integration

This project is a simple Python web application demonstrating OpenID Connect (OIDC) integration, token handling, and browser automation with Playwright.

Setup

  1. Install dependencies:
    • Create and activate a virtual environment
    • Run pip install -r requirements.txt
  2. Install Playwright browsers:
    • Run make playwright-install or python -m playwright install --with-deps
  3. Set the required environment variables.

Required Environment Variables

Set these before running the application (in your shell, Docker, or docker-compose):

  • CLIENT_ID — Your OIDC client ID
  • CLIENT_SECRET — Your OIDC client secret
  • AUTH_USERNAME - Your username at the authorization server
  • AUTH_PASSWORD - Your password at the authorization server
  • ISSUER_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

Running

  • Start the app locally:
     python app.py
  • Or with Docker Compose:
     make up

Formatting & Linting

  • Format code: make fmt
  • Lint code: make lint

Notes

  • 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.

About

Automated OIDC flow testing with Python and Playwright

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors