This repo builds a Keycloak image that bakes in a custom Authenticator SPI (github-team-admin).
CI proves the provider loads and can be attached to a flow via kcadm.sh before pushing the image.
# build the image locally (uses default KEYCLOAK_VERSION=24.0.5)
docker build -t keycloak/github-team-admin:dev .
# run with a local Postgres
docker network create kc-net || true
docker run -d --rm --name kc-db --network kc-net -e POSTGRES_USER=keycloak -e POSTGRES_PASSWORD=keycloak -e POSTGRES_DB=keycloak -p 5432:5432 postgres:15
# wait for db then run keycloak
docker run -d --rm --name kc --network kc-net -p 8080:8080 -e KC_DB=postgres -e KC_DB_URL=jdbc:postgresql://kc-db:5432/keycloak -e KC_DB_USERNAME=keycloak -e KC_DB_PASSWORD=keycloak -e KC_DB_SCHEMA=public keycloak/github-team-admin:dev
# health check
curl -fsS http://localhost:8080/health/ready- Builds the provider jar against the same Keycloak version as the runtime image.
- Boots Postgres + the built Keycloak image.
- Uses
kcadm.shto verify the provider appears and can be attached to a flow. - Only pushes if proof passes and the event is not a PR.
latest${KEYCLOAK_VERSION}(e.g.24.0.5)${KEYCLOAK_VERSION}-sha-${{ github.sha }}sha-${{ github.sha }}(from metadata-action)${{ inputs.image_version }}if provided via workflow_dispatch input (e.g.1.0.3)
Set the repository variable IMAGE_REPO to your destination, e.g.:
ghcr.io/your-org/keycloak-github-admindocker.io/youruser/keycloak-github-admin
For Docker Hub (or another registry), add secrets:
REGISTRY_USERNAMEREGISTRY_PASSWORD
The authenticator id is: github-team-admin
The sample implementation is a minimal pass-through authenticator so CI can prove load + attach mechanics. Extend it to call GitHub and grant roles as needed.
Provider id: google-groups-authenticator
Fetches Cloud Identity / Google Workspace group membership at login using a service account with domain-wide delegation. It supports external users by checking membership against a configured list of groups.
GOOGLE_ADMIN_EMAIL(orGOOGLE_DELEGATED_ADMIN) — delegated admin to impersonateGOOGLE_SA_JSON_PATHorGOOGLE_SA_JSON— service account JSON
GOOGLE_GROUPS— CSV list of group emails to checkGOOGLE_GROUP_ROLE_MAP— JSON map ofgroup-email→ roles- Example:
{"tier-pro@acme.com":["realm:tier_pro","client:public-app:feature_x"]}
- Example:
GOOGLE_AUTO_ROLES—true|false(defaulttrue) to auto-createggl:roles per groupGOOGLE_ROLE_PREFIX— prefix for auto roles (defaultggl:)
GOOGLE_STRICT_REVOKE—true|false(defaulttrue) revoke managed roles if no longer in groupGOOGLE_GROUPS_TTL_SECONDS— cache TTL (default600)
Ensure the service account is authorized for:
https://www.googleapis.com/auth/admin.directory.group.readonlyhttps://www.googleapis.com/auth/admin.directory.group.member.readonly