OfficialToolAuthenticationActive
postgres-keycloak-oauth-validator
cloudnative-pg/postgres-keycloak-oauth-validator ↗
PostgreSQL module that validates Keycloak-issued OAuth2 tokens.Keycloak発行のOAuth2トークンを検証するPostgreSQLモジュール
- ★
- 30
- Forks
- 5
- Contributors
- 3
- Updated
- 2026-09-15
- KC
- —
- License
- Apache-2.0
What it can doできること4
- Let PostgreSQL 18 delegate database role decisions to Keycloak Authorization Services using OAuth tokens (UMA ticket, decision response).PostgreSQL 18が、データベースロールの判定をOAuthトークンでKeycloakのAuthorization Servicesに委ねられる(UMAチケット、decision応答)
- Map each DB role to a Keycloak permission (
<resource>#<scope>) and control access with Keycloak policies; designed for CloudNativePG.DBロールをKeycloakのパーミッション(<resource>#<scope>)に対応付け、Keycloakのポリシーでアクセスを制御。CloudNativePG向けに設計 - Log in from psql with the OAuth device flow.psqlからOAuthのデバイスフローでログインできる
- Configure everything through PostgreSQL GUC parameters, with optional issuer (
iss) verification.設定はすべてPostgreSQLのGUCパラメータで行い、issuer(iss)の検証も任意で可能
What it cannot do / limitsできないこと・制約3
- Marked experimental.実験的(EXPERIMENTAL)と明記されている
- Requires PostgreSQL 18+ and relies on a Keycloak-specific extension (
response_mode=decision), so it does not work with other OAuth servers.PostgreSQL 18以上が必要。Keycloak固有の拡張(response_mode=decision)に依存するため、他のOAuthサーバーでは動かない - Not a Keycloak extension — it runs inside PostgreSQL.Keycloak拡張ではなく、PostgreSQL側で動くモジュール
Requirements前提条件
- A Keycloak realm with a resource-server client (Authorization Services on), a validator client, resources, scopes, permissions and policies; meson to build.リソースサーバー用クライアント(Authorization Servicesを有効化)、検証用クライアント、リソース・スコープ・パーミッション・ポリシーを設定したKeycloakのrealm。ビルドにはmesonが必要
- Trusted CA certificates in production (no self-signed certs).本番環境では信頼されたCAの証明書を使う(自己署名証明書は不可)