Skip to content

Packs / admin-panels-and-internal-tools-public

add-sso-with-keycloak

Add single sign-on with self-hosted Keycloak (OIDC, PKCE) and verify the discovery document an app depends on

Install

logicpacks pack use admin-panels-and-internal-tools-public/add-sso-with-keycloak
get_pack admin-panels-and-internal-tools-public/add-sso-with-keycloak

The second line is the MCP tool call for the LogicPacks connector (Claude Code, Codex, Claude.ai and others). The first run of a pack someone else wrote asks for your yes.

Keys it needs (names only)

  • KC_PG_PASSWORD
  • KC_ADMIN_PASSWORD

Playbooks included

  • Spec: spec/SPEC.md (goal, steps, edge cases, don’ts)
  • Routes: keycloak-dockerauthentik-docker
  • Checks: 5 in outcome/checks.yaml
  • Code: boot_check.shcompose_lint.pydocker-compose.ymloidc_check.py
  • Tools: python3, docker

Usage, last 8 weeks

New: no recorded use yet.

Purpose (from spec/SPEC.md)

Add single sign-on with self-hosted Keycloak (OIDC, PKCE) and verify the discovery document an app depends on

Goal

Our internal tools log in through one IdP with OIDC + PKCE, and an app refuses a misconfigured IdP.

Steps

  1. bash code/boot_check.sh -> Keycloak on 127.0.0.1:8084.
  2. Create realm internal, a client per app (confidential or public+PKCE), roles mapped to our RBAC roles.
  3. Check: oidc_check.py http://127.0.0.1:8084/realms/internal/.well-known/openid-configuration.
  4. Alternatives: Authentik (MIT core, EE flagged), Auth.js (ISC) inside Next.js apps.

Edge cases

  • start-dev is HTTP and in-memory caches: use start with hostname + TLS for real use.
  • Clock skew breaks token validation: NTP on all hosts.

Don'ts

  • Don't use implicit flow.
  • Don't expose the admin console publicly.