OfficialSPIProtocol Mapper / ClaimActive
keycloak-rest-claim-mapper
jowe112/keycloak-rest-claim-mapper ↗
OIDC/SAML mapper that enriches tokens from a REST API.REST APIの値でトークンを拡充するマッパー
- ★
- 2
- Forks
- 0
- Contributors
- 2
- Updated
- 2026-08-19
- KC
- 26.7.1
- License
- Apache-2.0
What it can doできること5
- Enrich OIDC tokens and SAML assertions with attributes fetched from external REST APIs at token issuance — works with any federation (LDAP, AD, User Storage SPI).トークン発行時に外部REST APIから属性を取得し、OIDCトークンやSAMLアサーションに追加できる。フェデレーションの種類(LDAP、AD、User Storage SPI)は問わない
- Call up to 3 endpoints in parallel, authenticating with an API key, basic auth or OAuth2 client credentials.最大3つのエンドポイントを並列で呼び出せる。認証はAPIキー・Basic認証・OAuth2クライアントクレデンシャルに対応
- Cache attributes with a TTL for imported users and fetch live for non-imported ones.インポート済みユーザーは属性をTTL付きでキャッシュし、非インポートのユーザーは毎回取得する
- Map with JSONPath, build query strings with JavaScript (GraalVM), and put structured JSON arrays into one claim (
json:prefix).JSONPathでのマッピング、JavaScript(GraalVM)でのクエリ文字列生成、構造化JSON配列の1クレームへの格納(json:接頭辞)ができる - Test endpoints from an admin panel without a real user login.実際のユーザーでログインしなくても、管理画面からエンドポイントをテストできる
What it cannot do / limitsできないこと・制約2
- Limited to 3 REST endpoints per mapper.1つのマッパーで扱えるRESTエンドポイントは3つまで
- Targets Keycloak 26.x on the Quarkus distribution with a GraalVM JDK (for the JavaScript feature).対象はQuarkus版のKeycloak 26.xで、GraalVM JDKが前提(JavaScript機能のため)
Requirements前提条件
- Java 21 and Maven 3.9+ to build; put the fat JAR in
/opt/keycloak/providers/.ビルドにJava 21とMaven 3.9以上。fat JARを/opt/keycloak/providers/に置く