クライアント
AccountMaker(以下「AM」)では、リダイレクト URI、許可オリジン、トークン設定を持つ Client を作成し、ダウンタイムなしで鍵をローテーションできます。
モバイルアプリ、Web アプリ、バックエンドサービスのいずれでも、用途ごとに独立したセキュリティ設定の Client を割り当てられます。
クライアント設定
{
id: "cid_...",
account_id: "acc_...",
name: "My Web App",
allowed_origins: ["https://app.example.com"],
redirect_uris: ["https://app.example.com/callback"],
access_token_config: {
expires_in: 3600 // 1 hour
},
refresh_token_config: {
expires_in: 1209600 // 14 days
}
}
操作
| Endpoint | Description |
|---|---|
POST /api/accounts/:account_id/clients | 新しい Client を登録 |
GET /api/accounts/:account_id/clients | Account の Client 一覧 |
GET /api/clients/:client_id | Client 詳細を取得 |
PATCH /api/clients/:client_id | 設定を変更 |
DELETE /api/clients/:client_id | Client を削除 |
鍵管理
Client は RSA 鍵ペアでトークンに署名します。AM は秘密鍵を安全に保持し、公開鍵を JWKS で公開します。
| Endpoint |
|---|
GET /api/clients/:client_id/keys |
POST /api/clients/:client_id/keys |
POST /api/clients/:client_id/jwks/rotate |
DELETE /api/client-keys/:client_key_id |
ローテーション中は既存トークン検証を維持するため、2〜4 本の鍵を同時に有効にしておくのが推奨です。
関連
- OAuth - OAuth フロー
- Client - クライアントリソース
- Client Key - 署名鍵