A demonstration OAuth2 / OpenID Connect (OIDC) client application built with Authlib. This project illustrates how to integrate with an identity provider for user authentication, registration, and consent management. It can be used to play with the different interactions between clients and server, or debug a server implementation.
pip install auth-playgrounduv add auth-playgroundRun the pre-built image from GitHub Container Registry:
docker run -p 4000:4000 -e SECRET_KEY="your-secret-key" ghcr.io/authlib/auth-playground:latestOr build locally:
docker build -t auth-playground .
docker run -p 4000:4000 -e SECRET_KEY="your-secret-key" auth-playgroundThe application is configured using environment variables. Copy the example configuration file:
cp example.env .envEdit .env and set the required values:
# Required
export SECRET_KEY="your-secret-key"
# Optional
export OAUTH_CLIENT_ID="your-client-id"
export OAUTH_CLIENT_SECRET="your-client-secret"
export OAUTH_AUTH_SERVER="https://your-identity-provider.example.com"When registering this application with your identity provider, configure the following redirect URIs:
http://localhost:4000/authorize_callback
http://localhost:4000/logout_callback
auth-playgroundThe application will be available at http://localhost:4000
uv run pytestuv run prek run --all-files