一键导入
dev-springboot
Spring Boot統合(idp-server-springboot-adapter)の開発・修正を行う際に使用。Controller パターン、Exception Handler、Filter、Spring Security 統合、Bean 定義実装時に役立つ。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Spring Boot統合(idp-server-springboot-adapter)の開発・修正を行う際に使用。Controller パターン、Exception Handler、Filter、Spring Security 統合、Bean 定義実装時に役立つ。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
UserInfoエンドポイント(UserInfo Endpoint)機能の開発・修正を行う際に使用。UserInfo claims、scopeフィルタリング、verified_claims実装時に役立つ。
外部API認証ユースケースの設定ガイド。外部API連携(認証委譲、リスク判定、OTP等)の interaction 設計、identity_match_field、MFA 2段階目、previous_interaction のヒアリングと設定JSONを提供。
ユースケース別セットアップのエントリポイント。ユーザーにユースケースを選択してもらい、対応するスキル(use-case-login, use-case-mfa等)にルーティングする。共通ワークフロー、前提条件、組み合わせパターンの概要を提供。
認証機能(Authentication Policy, MFA)の開発・修正を行う際に使用。認証ポリシー、パスワード、OTP、FIDO2、条件付き認証実装時に役立つ。
セキュリティ・脆弱性対策の開発・テストを行う際に使用。OAuth/OIDC攻撃対策、認証識別子切り替え攻撃、Session Fixation、マルチテナント分離、セキュリティテスト実装時に役立つ。
外部サービス連携(External Service Integration)機能の開発・修正を行う際に使用。HTTP Request Executor, MappingRule, OAuth/HMAC認証実装時に役立つ。
| name | dev-springboot |
| description | Spring Boot統合(idp-server-springboot-adapter)の開発・修正を行う際に使用。Controller パターン、Exception Handler、Filter、Spring Security 統合、Bean 定義実装時に役立つ。 |
documentation/docs/content_06_developer-guide/01-getting-started/02-architecture-overview.md - アーキテクチャ概要idp-server-springboot-adapter は HTTP/REST API の実装レイヤー。
鉄則: Controller にビジネスロジックは一切含まない。HTTP ↔ DTO 変換のみ。
探索起点: libs/idp-server-springboot-adapter/src/main/java/org/idp/server/adapters/springboot/
adapters/springboot/
application/restapi/oauth/ # OAuth/OIDC エンドポイント(OAuthV1Api 等)
control_plane/restapi/ # 管理 API(*ManagementV1Api)
configuration/ # Spring Bean 定義
ApiExceptionHandler.java # グローバル例外ハンドラー
DynamicCorsFilter.java # テナント動的 CORS
{Domain}ManagementV1Api(例: ClientManagementV1Api)OAuthV1Api, TokenV1Api 等@RestController
@RequestMapping("/v1/management/tenants/{tenant-id}/clients")
public class ClientManagementV1Api implements ParameterTransformable {
ClientManagementApi clientManagementApi; // control-plane API
public ClientManagementV1Api(IdpServerApplication idpServerApplication) {
this.clientManagementApi = idpServerApplication.clientManagementApi();
}
@PostMapping
public ResponseEntity<?> post(
@AuthenticationPrincipal OperatorPrincipal operatorPrincipal,
@PathVariable("tenant-id") TenantIdentifier tenantIdentifier,
@RequestBody(required = false) Map<String, Object> body,
HttpServletRequest httpServletRequest) {
// Phase 1: RequestAttributes 変換
RequestAttributes requestAttributes = transform(httpServletRequest);
// Phase 2: API 呼び出し
ClientManagementResponse response = clientManagementApi.create(
tenantIdentifier, operatorPrincipal.getUser(), ...);
// Phase 3: レスポンス生成
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add("content-type", "application/json");
return new ResponseEntity<>(response.contents(), httpHeaders,
HttpStatus.valueOf(response.statusCode()));
}
}
implements ParameterTransformable で HttpServletRequest → RequestAttributes 変換@AuthenticationPrincipal OperatorPrincipal で認証済みオペレーター取得@PathVariable("tenant-id") TenantIdentifier で型安全なパス変数IdpServerApplication 経由(Spring Bean 直接注入ではない)探索起点: ApiExceptionHandler.java
| 例外 | HTTP ステータス | エラーコード |
|---|---|---|
BadRequestException | 400 | invalid_request |
UnauthorizedException | 401 | invalid_request |
ForbiddenException | 403 | invalid_request |
NotFoundException | 404 | invalid_request |
ConflictException | 409 | invalid_request |
SqlDuplicateKeyException | 409 | duplicate_key |
| Filter | 責務 |
|---|---|
ManagementApiFilter | 管理 API のアクセストークン検証・権限検証 |
OrgManagementFilter | 組織レベル API の認証・認可 |
DynamicCorsFilter | テナント固有の CORS 設定を動的適用 |
@Configuration
public class DataSourceConfiguration {
@Bean
public ClientConfigurationQueryRepository clientConfigurationQueryRepository(
DataSource dataSource) {
ClientConfigurationSqlExecutor executor = new PostgresqlExecutor(dataSource);
return new ClientConfigurationQueryDataSource(executor);
}
}
管理 API のアクセストークン検証・権限検証を行う。OperatorPrincipal を SecurityContextHolder にセット。
組織レベル API 用。URL からの OrganizationIdentifier 解決 + 組織の admin テナントでのトークン検証。OrganizationOperatorPrincipal をセット。
| 項目 | ManagementApiFilter | OrgManagementFilter |
|---|---|---|
| エンドポイント | /management/* | /management/organizations/{orgId}/* |
| Principal | OperatorPrincipal | OrganizationOperatorPrincipal |
| スコープ | management | org-management or management |
テナント固有の CORS 設定を動的適用。リクエストパスからテナントを解決し、CorsConfiguration を取得。
テナント解決順序:
MaliciousInputException → 400 (invalid_request)
BadRequestException → 400 (invalid_request)
UnauthorizedException → 401 (invalid_request)
ForbiddenException → 403 (invalid_request)
NotFoundException → 404 (invalid_request)
NoResourceFoundException → 404 (invalid_request)
ConflictException → 409 (invalid_request)
SqlDuplicateKeyException → 409 (duplicate_key)
HttpRequestMethodNotSupported → 405 (invalid_request)
HttpMediaTypeNotAcceptable → 406 (invalid_request)
HttpMediaTypeNotSupported → 400 (invalid_request)
HttpMessageConversionException → 400 (invalid_request)
DateTimeParseException → 400 (invalid_request)
InvalidConfigurationException → 500 (server_error)
Exception (catch-all) → 500 (server_error)
MaliciousInputException は攻撃詳細を ERROR ログに記録するが、レスポンスには汎用メッセージのみ返す(セキュリティ原則)。
Controller (V1Api) ← HTTP ↔ DTO 変換のみ
↓
Control-Plane API ← EntryService 呼び出し(Proxy でラップ)
↓
EntryService (UseCase層) ← オーケストレーション
↓
Core層 ← ドメインロジック