auth-playground 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. auth_playground-0.0.1/.claude/settings.local.json +46 -0
  2. auth_playground-0.0.1/.dockerignore +48 -0
  3. auth_playground-0.0.1/.github/workflows/i18n.yml +59 -0
  4. auth_playground-0.0.1/.github/workflows/publish-docker.yaml +47 -0
  5. auth_playground-0.0.1/.github/workflows/release.yml +25 -0
  6. auth_playground-0.0.1/.github/workflows/tests.yaml +119 -0
  7. auth_playground-0.0.1/.gitignore +12 -0
  8. auth_playground-0.0.1/.hgignore +1 -0
  9. auth_playground-0.0.1/.pre-commit-config.yaml +38 -0
  10. auth_playground-0.0.1/.python-version +1 -0
  11. auth_playground-0.0.1/Dockerfile +48 -0
  12. auth_playground-0.0.1/LICENSE.md +21 -0
  13. auth_playground-0.0.1/PKG-INFO +110 -0
  14. auth_playground-0.0.1/README.md +89 -0
  15. auth_playground-0.0.1/auth-playground.spec +79 -0
  16. auth_playground-0.0.1/example.env +16 -0
  17. auth_playground-0.0.1/hatch_build.py +27 -0
  18. auth_playground-0.0.1/pyproject.toml +167 -0
  19. auth_playground-0.0.1/src/auth_playground/__init__.py +157 -0
  20. auth_playground-0.0.1/src/auth_playground/cli.py +19 -0
  21. auth_playground-0.0.1/src/auth_playground/endpoints.py +284 -0
  22. auth_playground-0.0.1/src/auth_playground/forms.py +91 -0
  23. auth_playground-0.0.1/src/auth_playground/i18n.py +76 -0
  24. auth_playground-0.0.1/src/auth_playground/oauth.py +368 -0
  25. auth_playground-0.0.1/src/auth_playground/session.py +79 -0
  26. auth_playground-0.0.1/src/auth_playground/specs.py +453 -0
  27. auth_playground-0.0.1/src/auth_playground/static/css/custom.css +207 -0
  28. auth_playground-0.0.1/src/auth_playground/static/css/pico.colors.min.css +4 -0
  29. auth_playground-0.0.1/src/auth_playground/static/css/pico.min.css +4 -0
  30. auth_playground-0.0.1/src/auth_playground/static/js/copy-token.js +28 -0
  31. auth_playground-0.0.1/src/auth_playground/templates/authenticated.html +214 -0
  32. auth_playground-0.0.1/src/auth_playground/templates/configure_client.html +116 -0
  33. auth_playground-0.0.1/src/auth_playground/templates/configure_server.html +50 -0
  34. auth_playground-0.0.1/src/auth_playground/templates/layout.html +86 -0
  35. auth_playground-0.0.1/src/auth_playground/templates/playground.html +50 -0
  36. auth_playground-0.0.1/src/auth_playground/templates/policy.html +101 -0
  37. auth_playground-0.0.1/src/auth_playground/templates/server_specs.html +36 -0
  38. auth_playground-0.0.1/src/auth_playground/templates/specs.html +40 -0
  39. auth_playground-0.0.1/src/auth_playground/templates/static-configuration.html +33 -0
  40. auth_playground-0.0.1/src/auth_playground/templates/tos.html +63 -0
  41. auth_playground-0.0.1/src/auth_playground/translations/README.md +42 -0
  42. auth_playground-0.0.1/src/auth_playground/translations/fr/LC_MESSAGES/messages.po +983 -0
  43. auth_playground-0.0.1/src/auth_playground/translations/messages.pot +230 -0
  44. auth_playground-0.0.1/tests/__init__.py +0 -0
  45. auth_playground-0.0.1/tests/conftest.py +81 -0
  46. auth_playground-0.0.1/tests/test_authentication.py +220 -0
  47. auth_playground-0.0.1/tests/test_configuration.py +360 -0
  48. auth_playground-0.0.1/tests/test_debug_features.py +18 -0
  49. auth_playground-0.0.1/tests/test_endpoints_errors.py +255 -0
  50. auth_playground-0.0.1/tests/test_i18n.py +13 -0
  51. auth_playground-0.0.1/tests/test_init.py +28 -0
  52. auth_playground-0.0.1/tests/test_oauth_advanced.py +214 -0
  53. auth_playground-0.0.1/tests/test_session.py +116 -0
  54. auth_playground-0.0.1/tests/test_specs.py +476 -0
  55. auth_playground-0.0.1/uv.lock +1515 -0
@@ -0,0 +1,46 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Read(//home/eloi/dev/yaal/canaille/dev/client/**)",
5
+ "Bash(tree:*)",
6
+ "WebSearch",
7
+ "WebFetch(domain:cdn.jsdelivr.net)",
8
+ "Bash(curl:*)",
9
+ "WebFetch(domain:docs.astral.sh)",
10
+ "WebFetch(domain:picocss.com)",
11
+ "WebFetch(domain:github.com)",
12
+ "Bash(git mv:*)",
13
+ "WebFetch(domain:pytest-iam.readthedocs.io)",
14
+ "Read(//home/eloi/dev/yaal/**)",
15
+ "Bash(uv sync:*)",
16
+ "Bash(uv pip index:*)",
17
+ "Bash(uv run pytest:*)",
18
+ "Bash(git -C /home/eloi/dev/yaal/pytest-iam log:*)",
19
+ "Bash(git -C /home/eloi/dev/yaal/pytest-iam describe --tags)",
20
+ "Bash(git -C /home/eloi/dev/yaal/pytest-iam show ade288e --stat)",
21
+ "Bash(git -C /home/eloi/dev/yaal/pytest-iam show ade288e)",
22
+ "Bash(uv run:*)",
23
+ "Bash(uv pip show:*)",
24
+ "WebFetch(domain:canaille.yaal.coop)",
25
+ "WebFetch(domain:datatracker.ietf.org)",
26
+ "WebFetch(domain:openid.net)",
27
+ "Bash(prek run:*)",
28
+ "WebFetch(domain:oauth.net)",
29
+ "WebFetch(domain:www.sakimura.org)",
30
+ "Bash(tox:*)",
31
+ "WebFetch(domain:pyinstaller.org)",
32
+ "Bash(pybabel compile:*)",
33
+ "WebFetch(domain:python-babel.github.io)",
34
+ "WebFetch(domain:stackoverflow.com)",
35
+ "Bash(msgfmt:*)",
36
+ "Read(//tmp/**)",
37
+ "WebFetch(domain:medium.com)",
38
+ "Bash(python -c:*)",
39
+ "Bash(git add:*)",
40
+ "Bash(find:*)",
41
+ "Bash(test:*)"
42
+ ],
43
+ "deny": [],
44
+ "ask": []
45
+ }
46
+ }
@@ -0,0 +1,48 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ *.egg-info/
8
+ dist/
9
+ build/
10
+ .eggs/
11
+ *.egg
12
+ .venv/
13
+ venv/
14
+ ENV/
15
+ env/
16
+
17
+ # Testing
18
+ .tox/
19
+ .coverage
20
+ .coverage.*
21
+ htmlcov/
22
+ .pytest_cache/
23
+
24
+ # IDEs
25
+ .vscode/
26
+ .idea/
27
+ *.swp
28
+ *.swo
29
+ *~
30
+
31
+ # Git
32
+ .git/
33
+ .gitignore
34
+
35
+ # Docker
36
+ Dockerfile
37
+ .dockerignore
38
+ docker-compose.yml
39
+
40
+ # Environment files (security)
41
+ .env
42
+ .env.*
43
+ !example.env
44
+
45
+ # Build artifacts
46
+ *.spec
47
+ dist/
48
+ build/
@@ -0,0 +1,59 @@
1
+ name: Check translation catalogs are up to date
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - main
7
+ push:
8
+ branches:
9
+ - main
10
+
11
+ jobs:
12
+ check-translations:
13
+ name: Verify translation catalogs
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v5
17
+
18
+ - name: Install uv
19
+ uses: astral-sh/setup-uv@v5
20
+ with:
21
+ enable-cache: true
22
+
23
+ - name: Set up Python
24
+ uses: actions/setup-python@v6
25
+ with:
26
+ python-version-file: "pyproject.toml"
27
+
28
+ - name: Install dependencies
29
+ run: uv sync --all-groups --all-extras
30
+
31
+ - name: Save current catalog (filtered)
32
+ run: |
33
+ grep -v '^"POT-Creation-Date:' src/auth_playground/translations/messages.pot | \
34
+ grep -v '^"Generated-By:' | \
35
+ grep -v '^#:' | \
36
+ grep -v '^#,' > /tmp/messages.pot.before
37
+
38
+ - name: Extract translation strings
39
+ run: uv run pybabel extract --mapping-file pyproject.toml --copyright-holder="Yaal Coop" --output-file src/auth_playground/translations/messages.pot src
40
+
41
+ - name: Save new catalog (filtered)
42
+ run: |
43
+ grep -v '^"POT-Creation-Date:' src/auth_playground/translations/messages.pot | \
44
+ grep -v '^"Generated-By:' | \
45
+ grep -v '^#:' | \
46
+ grep -v '^#,' > /tmp/messages.pot.after
47
+
48
+ - name: Check for uncommitted changes in catalogs
49
+ run: |
50
+ # Compare filtered files
51
+ if diff -u /tmp/messages.pot.before /tmp/messages.pot.after; then
52
+ echo "Translation catalogs are up to date"
53
+ else
54
+ echo "Translation catalogs are not up to date!"
55
+ echo ""
56
+ echo "New translatable strings were found or existing ones were modified."
57
+ echo "Please check instructions in src/auth_playground/README.md and extract the strings."
58
+ exit 1
59
+ fi
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: Publish Docker image
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*.*.*'
7
+ jobs:
8
+ publish:
9
+ name: Build and publish Docker image
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ contents: read
13
+ packages: write
14
+ steps:
15
+ - uses: actions/checkout@v5
16
+
17
+ - name: Set up Docker Buildx
18
+ uses: docker/setup-buildx-action@v3
19
+
20
+ - name: Log in to GitHub Container Registry
21
+ uses: docker/login-action@v3
22
+ with:
23
+ registry: ghcr.io
24
+ username: ${{ github.actor }}
25
+ password: ${{ secrets.GITHUB_TOKEN }}
26
+
27
+ - name: Extract metadata
28
+ id: meta
29
+ uses: docker/metadata-action@v5
30
+ with:
31
+ images: ghcr.io/${{ github.repository }}
32
+ tags: |
33
+ type=semver,pattern={{version}}
34
+ type=semver,pattern={{major}}.{{minor}}
35
+ type=semver,pattern={{major}}
36
+ type=raw,value=latest,enable={{is_default_branch}}
37
+
38
+ - name: Build and push Docker image
39
+ uses: docker/build-push-action@v6
40
+ with:
41
+ context: .
42
+ push: true
43
+ tags: ${{ steps.meta.outputs.tags }}
44
+ labels: ${{ steps.meta.outputs.labels }}
45
+ cache-from: type=gha
46
+ cache-to: type=gha,mode=max
47
+ platforms: linux/amd64,linux/arm64
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: release
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*.*.*'
7
+ jobs:
8
+ release:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v5
12
+ - name: Install uv
13
+ uses: astral-sh/setup-uv@v5
14
+ with:
15
+ enable-cache: true
16
+ - run: |
17
+ export TZ=UTC
18
+ uv sync --group release --all-extras --no-dev
19
+ uv run pyinstaller auth-playground.spec
20
+ uv cache prune --ci
21
+ - uses: softprops/action-gh-release@v2
22
+ if: github.ref_type == 'tag'
23
+ with:
24
+ files: |
25
+ dist/auth-playground
@@ -0,0 +1,119 @@
1
+ ---
2
+ name: tests
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ - '*.*.*'
8
+ pull_request:
9
+ branches:
10
+ - main
11
+ - '*.*.*'
12
+ jobs:
13
+ tests:
14
+ name: py${{ matrix.python }} unit tests
15
+ runs-on: ubuntu-latest
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ python:
20
+ - '3.13'
21
+ - '3.12'
22
+ - '3.11'
23
+ - '3.10'
24
+ steps:
25
+ - uses: actions/checkout@v5
26
+ - name: Install uv
27
+ uses: astral-sh/setup-uv@v5
28
+ with:
29
+ enable-cache: true
30
+ - name: Install Python ${{ matrix.python }}
31
+ run: uv python install ${{ matrix.python }}
32
+ - name: Run tests
33
+ run: |
34
+ export TZ=UTC
35
+ uv sync --all-extras
36
+ uv run pytest
37
+
38
+ minversions:
39
+ name: minimum dependency versions
40
+ runs-on: ubuntu-latest
41
+ steps:
42
+ - uses: actions/checkout@v5
43
+ - name: Install uv
44
+ uses: astral-sh/setup-uv@v5
45
+ with:
46
+ enable-cache: true
47
+ - name: Install Python 3.10
48
+ run: uv python install 3.10
49
+ - name: Run tests
50
+ run: |
51
+ export TZ=UTC
52
+ uv sync --all-extras --resolution=lowest-direct
53
+ uv run pytest
54
+
55
+ style:
56
+ runs-on: ubuntu-latest
57
+ steps:
58
+ - uses: actions/checkout@v5
59
+ - name: Install uv
60
+ uses: astral-sh/setup-uv@v5
61
+ with:
62
+ enable-cache: true
63
+ - name: Run tests
64
+ run: |
65
+ export TZ=UTC
66
+ uv sync --all-extras
67
+ uv run prek run --all-files
68
+
69
+ bundle:
70
+ runs-on: ubuntu-latest
71
+ steps:
72
+ - uses: actions/checkout@v5
73
+ - name: Install uv
74
+ uses: astral-sh/setup-uv@v5
75
+ with:
76
+ enable-cache: true
77
+ - run: |
78
+ export TZ=UTC
79
+ uv sync --group release --all-extras --no-dev
80
+ uv run pyinstaller auth-playground.spec
81
+ uv cache prune --ci
82
+
83
+ docker:
84
+ name: docker build
85
+ runs-on: ubuntu-latest
86
+ steps:
87
+ - uses: actions/checkout@v5
88
+ - name: Set up Docker Buildx
89
+ uses: docker/setup-buildx-action@v3
90
+ - name: Build Docker image
91
+ uses: docker/build-push-action@v6
92
+ with:
93
+ context: .
94
+ push: false
95
+ load: true
96
+ tags: auth-playground:test
97
+ cache-from: type=gha
98
+ cache-to: type=gha,mode=max
99
+ - name: Test Docker image
100
+ run: |
101
+ docker run -d --name test-app -p 4000:4000 \
102
+ -e SECRET_KEY="test-secret-key-for-ci" \
103
+ -e FLASK_DEBUG="False" \
104
+ auth-playground:test
105
+
106
+ timeout 30 sh -c 'until docker inspect --format="{{.State.Health.Status}}" test-app | grep -q "healthy"; do sleep 1; done' || {
107
+ echo "Container failed to become healthy"
108
+ docker logs test-app
109
+ exit 1
110
+ }
111
+
112
+ curl -f http://localhost:4000/ || {
113
+ echo "App failed to respond"
114
+ docker logs test-app
115
+ exit 1
116
+ }
117
+
118
+ docker stop test-app
119
+ docker rm test-app
@@ -0,0 +1,12 @@
1
+ .env
2
+ *.pyc
3
+ *.mo
4
+ *.prof
5
+ .tox
6
+ .coverage
7
+ .coverage.*
8
+ htmlcov
9
+ *.egg-info
10
+ build
11
+ _build
12
+ dist
@@ -0,0 +1 @@
1
+ .dotfiles/mercurial/.hgignore
@@ -0,0 +1,38 @@
1
+ ---
2
+ repos:
3
+ - repo: https://github.com/astral-sh/ruff-pre-commit
4
+ rev: v0.14.0
5
+ hooks:
6
+ - id: ruff
7
+ args: [--fix, --exit-non-zero-on-fix]
8
+ - id: ruff-format
9
+ - repo: https://github.com/pre-commit/pre-commit-hooks
10
+ rev: v6.0.0
11
+ hooks:
12
+ - id: fix-byte-order-marker
13
+ - id: trailing-whitespace
14
+ exclude: "\\.svg$|\\.map$|\\.min\\.css$|\\.min\\.js$|\\.po$|\\.pot$"
15
+ - id: end-of-file-fixer
16
+ exclude: "\\.svg$|\\.map$|\\.min\\.css$|\\.min\\.js$|\\.po$|\\.pot$"
17
+ - id: check-toml
18
+ - repo: https://github.com/rtts/djhtml
19
+ rev: 3.0.10
20
+ hooks:
21
+ - id: djhtml
22
+ - repo: https://github.com/codespell-project/codespell
23
+ rev: v2.4.1
24
+ hooks:
25
+ - id: codespell
26
+ additional_dependencies:
27
+ - tomli
28
+ exclude: ".*\\.min\\..*|translations|\\.css$|^tests|fomanticui|doc/locales|auth-playground\\.spec"
29
+ args: [--write-changes]
30
+ - repo: local
31
+ hooks:
32
+ - id: pybabel-extract
33
+ name: Extract translatable strings
34
+ entry: bash -c 'uv run pybabel extract -o src/auth_playground/translations/messages.pot src/auth_playground && git add src/auth_playground/translations/messages.pot'
35
+ language: system
36
+ pass_filenames: false
37
+ files: '\.(py|html)$'
38
+ exclude: '^tests/'
@@ -0,0 +1 @@
1
+ 3.14
@@ -0,0 +1,48 @@
1
+ # syntax=docker/dockerfile:1
2
+ FROM ghcr.io/astral-sh/uv:python3.14-bookworm-slim AS builder
3
+
4
+ WORKDIR /app
5
+
6
+ # Install build dependencies for compiling native extensions
7
+ RUN apt-get update && apt-get install -y --no-install-recommends \
8
+ build-essential \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ ENV UV_COMPILE_BYTECODE=1
12
+
13
+ COPY pyproject.toml uv.lock ./
14
+
15
+ RUN --mount=type=cache,target=/root/.cache/uv \
16
+ uv sync --frozen --no-install-project --no-dev
17
+
18
+ COPY . .
19
+
20
+ RUN --mount=type=cache,target=/root/.cache/uv \
21
+ uv sync --frozen --no-dev
22
+
23
+
24
+ FROM python:3.14-slim-bookworm
25
+
26
+ # Create a non-root user
27
+ RUN useradd -m -u 1000 appuser
28
+
29
+ WORKDIR /app
30
+
31
+ COPY --from=builder --chown=appuser:appuser /app/.venv /app/.venv
32
+
33
+ COPY --chown=appuser:appuser . .
34
+
35
+ ENV PATH="/app/.venv/bin:$PATH"
36
+ ENV PYTHONUNBUFFERED=1
37
+ ENV FLASK_RUN_HOST="0.0.0.0"
38
+ ENV FLASK_RUN_PORT="4000"
39
+ ENV FLASK_DEBUG="False"
40
+
41
+ USER appuser
42
+
43
+ EXPOSE 4000
44
+
45
+ HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
46
+ CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:4000/').read()" || exit 1
47
+
48
+ CMD ["auth-playground"]
@@ -0,0 +1,21 @@
1
+ # MIT License
2
+
3
+ Copyright (c) 2025 Yaal Coop
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,110 @@
1
+ Metadata-Version: 2.4
2
+ Name: auth-playground
3
+ Version: 0.0.1
4
+ Summary: Demonstration OpenID Connect Client
5
+ Project-URL: repository, https://github.com/yaal-coop/auth-playground
6
+ Author-email: Yaal Coop <contact@yaal.coop>
7
+ Maintainer-email: Éloi Rivard <eloi@yaal.coop>
8
+ License: MIT
9
+ License-File: LICENSE.md
10
+ Keywords: authentication,identity,oauth,oauth2,oidc,openid
11
+ Requires-Python: >=3.10
12
+ Requires-Dist: authlib>=1.6.5
13
+ Requires-Dist: cachelib>=0.10.0
14
+ Requires-Dist: flask-babel>=4.0.0
15
+ Requires-Dist: flask-session>=0.8.0
16
+ Requires-Dist: flask-wtf>=1.2.0
17
+ Requires-Dist: flask>=3.1.2
18
+ Requires-Dist: python-dotenv>=1.0.0
19
+ Requires-Dist: requests>=2.32.5
20
+ Description-Content-Type: text/markdown
21
+
22
+ # Auth Playground
23
+
24
+ [![Tests](https://github.com/authlib/auth-playground/actions/workflows/tests.yaml/badge.svg)](https://github.com/authlib/auth-playground/actions/workflows/tests.yaml)
25
+ [![Docker](https://github.com/authlib/auth-playground/actions/workflows/publish-docker.yaml/badge.svg)](https://github.com/authlib/auth-playground/actions/workflows/publish-docker.yaml)
26
+ [![Docker Image](https://ghcr-badge.egpl.dev/authlib/auth-playground/latest_tag?trim=major&label=latest)](https://github.com/authlib/auth-playground/pkgs/container/auth-playground)
27
+
28
+ A demonstration OAuth2 / OpenID Connect (OIDC) client application built with [Authlib](https://authlib.org).
29
+ This project illustrates how to integrate with an identity provider for user authentication, registration, and consent management.
30
+ It can be used to play with the different interactions between clients and server, or debug a server implementation.
31
+
32
+ ## Installation
33
+
34
+ ### Using pip
35
+
36
+ ```bash
37
+ pip install auth-playground
38
+ ```
39
+
40
+ ### Using uv
41
+
42
+ ```bash
43
+ uv add auth-playground
44
+ ```
45
+
46
+ ### Using Docker
47
+
48
+ Run the pre-built image from GitHub Container Registry:
49
+
50
+ ```bash
51
+ docker run -p 4000:4000 -e SECRET_KEY="your-secret-key" ghcr.io/authlib/auth-playground:latest
52
+ ```
53
+
54
+ Or build locally:
55
+
56
+ ```bash
57
+ docker build -t auth-playground .
58
+ docker run -p 4000:4000 -e SECRET_KEY="your-secret-key" auth-playground
59
+ ```
60
+
61
+ ## Configuration
62
+
63
+ The application is configured using environment variables. Copy the example configuration file:
64
+
65
+ ```bash
66
+ cp example.env .env
67
+ ```
68
+
69
+ Edit `.env` and set the required values:
70
+
71
+ ```bash
72
+ # Required
73
+ export SECRET_KEY="your-secret-key"
74
+
75
+ # Optional
76
+ export OAUTH_CLIENT_ID="your-client-id"
77
+ export OAUTH_CLIENT_SECRET="your-client-secret"
78
+ export OAUTH_AUTH_SERVER="https://your-identity-provider.example.com"
79
+ ```
80
+
81
+ ### Registering with your Identity Provider
82
+
83
+ When registering this application with your identity provider, configure the following redirect URIs:
84
+
85
+ ```
86
+ http://localhost:4000/login_callback
87
+ http://localhost:4000/logout_callback
88
+ ```
89
+
90
+ ## Usage
91
+
92
+ ```bash
93
+ auth-playground
94
+ ```
95
+
96
+ The application will be available at `http://localhost:4000`
97
+
98
+ ## Development
99
+
100
+ ### Running Tests
101
+
102
+ ```bash
103
+ uv run pytest
104
+ ```
105
+
106
+ ### Code Style
107
+
108
+ ```bash
109
+ uv run prek run --all-files
110
+ ```
@@ -0,0 +1,89 @@
1
+ # Auth Playground
2
+
3
+ [![Tests](https://github.com/authlib/auth-playground/actions/workflows/tests.yaml/badge.svg)](https://github.com/authlib/auth-playground/actions/workflows/tests.yaml)
4
+ [![Docker](https://github.com/authlib/auth-playground/actions/workflows/publish-docker.yaml/badge.svg)](https://github.com/authlib/auth-playground/actions/workflows/publish-docker.yaml)
5
+ [![Docker Image](https://ghcr-badge.egpl.dev/authlib/auth-playground/latest_tag?trim=major&label=latest)](https://github.com/authlib/auth-playground/pkgs/container/auth-playground)
6
+
7
+ A demonstration OAuth2 / OpenID Connect (OIDC) client application built with [Authlib](https://authlib.org).
8
+ This project illustrates how to integrate with an identity provider for user authentication, registration, and consent management.
9
+ It can be used to play with the different interactions between clients and server, or debug a server implementation.
10
+
11
+ ## Installation
12
+
13
+ ### Using pip
14
+
15
+ ```bash
16
+ pip install auth-playground
17
+ ```
18
+
19
+ ### Using uv
20
+
21
+ ```bash
22
+ uv add auth-playground
23
+ ```
24
+
25
+ ### Using Docker
26
+
27
+ Run the pre-built image from GitHub Container Registry:
28
+
29
+ ```bash
30
+ docker run -p 4000:4000 -e SECRET_KEY="your-secret-key" ghcr.io/authlib/auth-playground:latest
31
+ ```
32
+
33
+ Or build locally:
34
+
35
+ ```bash
36
+ docker build -t auth-playground .
37
+ docker run -p 4000:4000 -e SECRET_KEY="your-secret-key" auth-playground
38
+ ```
39
+
40
+ ## Configuration
41
+
42
+ The application is configured using environment variables. Copy the example configuration file:
43
+
44
+ ```bash
45
+ cp example.env .env
46
+ ```
47
+
48
+ Edit `.env` and set the required values:
49
+
50
+ ```bash
51
+ # Required
52
+ export SECRET_KEY="your-secret-key"
53
+
54
+ # Optional
55
+ export OAUTH_CLIENT_ID="your-client-id"
56
+ export OAUTH_CLIENT_SECRET="your-client-secret"
57
+ export OAUTH_AUTH_SERVER="https://your-identity-provider.example.com"
58
+ ```
59
+
60
+ ### Registering with your Identity Provider
61
+
62
+ When registering this application with your identity provider, configure the following redirect URIs:
63
+
64
+ ```
65
+ http://localhost:4000/login_callback
66
+ http://localhost:4000/logout_callback
67
+ ```
68
+
69
+ ## Usage
70
+
71
+ ```bash
72
+ auth-playground
73
+ ```
74
+
75
+ The application will be available at `http://localhost:4000`
76
+
77
+ ## Development
78
+
79
+ ### Running Tests
80
+
81
+ ```bash
82
+ uv run pytest
83
+ ```
84
+
85
+ ### Code Style
86
+
87
+ ```bash
88
+ uv run prek run --all-files
89
+ ```