OfficialSPIAuthenticationActive

keycloak-personal-access-tokens

mrulex-repo/keycloak-personal-access-tokens ↗

Scoped personal access tokens usable as Basic Auth passwords.Basic認証で使えるスコープ付き個人アクセストークン

★
4
Forks
0
Contributors
1
Updated
2026-05-20
KC
—
License
GPL-3.0

What it can doできること5

  • Let users create named personal access tokens (PATs) from the Account UI — scoped to chosen realm roles, revocable, with optional expiry.ユーザーがアカウント画面から、名前付きの個人アクセストークン(PAT)を作成できる。選んだrealmロールに限定でき、失効も可能で、有効期限も任意で設定できる
  • Use PATs as passwords wherever HTTP Basic Auth is used (Maven/Docker/npm registries, IMAP) — services validate them against an /auth endpoint that returns the roles in X-Roles.HTTP Basic認証しか使えないサービス(Maven/Docker/npmレジストリ、IMAPなど)で、PATをパスワードとして使える。サービスは /auth エンドポイントで検証し、ロールは X-Roles ヘッダーで返る
  • Let Keycloak enforce a required role (X-Required-Role → 403); examples for nginx, Traefik forwardAuth and Spring Boot.必要なロールのチェックをKeycloak側に任せられる(X-Required-Role → 403)。nginx・Traefik forwardAuth・Spring Bootでの利用例あり
  • Use PATs in the direct-grant (password) flow via a dedicated authenticator and roles token mapper.専用のAuthenticatorとロールのトークンマッパーで、ダイレクトグラント(パスワード)フローでもPATを使える
  • Tokens are shown once and stored only as Argon2id hashes.トークンは作成時に1度だけ表示され、保存されるのはArgon2idのハッシュのみ

What it cannot do / limitsできないこと・制約3

  • Tokens carry realm roles only.トークンに含められるのはrealmロールだけ
  • Direct-grant use requires a custom flow bound per client; other clients still need the real password.ダイレクトグラントで使うには、カスタムフローをクライアントごとにバインドする必要がある。それ以外のクライアントでは本来のパスワードが必要
  • Built for Keycloak 26 only, and licensed under GPL-3.0.対象はKeycloak 26のみ。ライセンスはGPL-3.0

Requirements前提条件