Skip to content

authlib/auth-playground

Repository files navigation

Auth Playground

Tests Docker Docker Image

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.

Installation

Using pip

pip install auth-playground

Using uv

uv add auth-playground

Using Docker

Run the pre-built image from GitHub Container Registry:

docker run -p 4000:4000 -e SECRET_KEY="your-secret-key" ghcr.io/authlib/auth-playground:latest

Or build locally:

docker build -t auth-playground .
docker run -p 4000:4000 -e SECRET_KEY="your-secret-key" auth-playground

Configuration

The application is configured using environment variables. Copy the example configuration file:

cp example.env .env

Edit .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"

Registering with your Identity Provider

When registering this application with your identity provider, configure the following redirect URIs:

http://localhost:4000/authorize_callback
http://localhost:4000/logout_callback

Usage

auth-playground

The application will be available at http://localhost:4000

Development

Running Tests

uv run pytest

Code Style

uv run prek run --all-files

About

Demonstration OAuth2 / OIDC client

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages