カスタムクレーム(Custom Claims)開発ガイド
SkillDev toolsUsed when developing or modifying the Custom Claims feature. Helpful when implementing claims: scope mapping and verified_claims: mapping.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the カスタムクレーム(Custom Claims)開発ガイド skill
What this skill tells your AI
The instructions your AI receives, as published by fdu-ins/insurance-skills in Skills/custom-claims/SKILL.md and read by ahel’s review.
ドキュメント
documentation/docs/content_03_concepts/04-tokens-claims/concept-03-custom-claims.md- カスタムクレーム概念documentation/docs/content_03_concepts/04-tokens-claims/concept-01-id-token.md- ID Token概念
機能概要
カスタムクレーム機能は、ID Tokenに任意の属性を含める層。
- カスタムクレームscopeマッピング:
claims:attribute_name構文 - Verified claimマッピング:
verified_claims:attribute_name構文(OIDC4IDA準拠)
モジュール構成
libs/
└── idp-server-core/ # クレームコア
└── .../oauth/
├── response/
│ ├── AuthorizationResponseIdTokenCreator.java
│ ├── AuthorizationResponseCodeIdTokenCreator.java
│ └── AuthorizationResponseCodeTokenIdTokenCreator.java
└── token/
└── (トークン生成関連クラス)
ID Token生成
idp-server-core/oauth/response/ 内:
ID Token生成は、response type別に複数のCreatorクラスが存在します:
| クラス | 用途 |
|---|---|
AuthorizationResponseIdTokenCreator | Implicit FlowでのID Token生成 |
AuthorizationResponseCodeIdTokenCreator | Authorization Code Flowでのresponse ID Token生成 |
AuthorizationResponseCodeTokenIdTokenCreator | Hybrid Flowでのresponse ID Token生成 |
カスタムクレームscopeマッピング
Scope構文
claims:attribute_name
カスタムクレームは、claims: プレフィックスでscopeを指定することで、
ID Tokenに任意の属性を含めることができます。
Verified Claimマッピング(OIDC4IDA)
Scope構文
verified_claims:attribute_name
Verified Claimは、verified_claims: プレフィックスでscopeを指定することで、
本人確認済みの属性をID Tokenに含めることができます。
前提条件: ユーザーが本人確認済み(isIdentityVerified())であること
E2Eテスト
e2e/src/tests/
└── spec/
├── oidc_core_2_id_token.test.js # ID Token仕様テスト
└── oidc_core_2_id_token_extension.test.js
コマンド
# ビルド
./gradlew :libs:idp-server-core:compileJava
# テスト
cd e2e && npm test -- spec/oidc_core_2_id_token.test.js
cd e2e && npm test -- spec/oidc_core_2_id_token_extension.test.js
トラブルシューティング
カスタムクレームがID Tokenに含まれない
- Scope形式が正しいか確認(
claims:attribute_name) - ユーザーの
custom_propertiesに属性が存在するか確認
Verified Claimが含まれない
- ユーザーが本人確認済みか確認(
user.isIdentityVerified()) - 認証方式が要件を満たすか確認
Signals
- GitHub stars
- 73
- Forks
- 19
- Last commit
- Jul 2026
Advanced
- Catalog kind
- skill
- Gateway key
custom-claims- Source
- github.com/fdu-ins/insurance-skills