Client
Client は、ユーザー認証とトークン要求を行う OAuth 2.0 アプリケーションです。許可オリジン、リダイレクト URI、トークン設定を定義します。
スキーマ
interface Client {
id: string; // "cid..." - 一意識別子
resource_id: string; // 所有元の application または account
issuer: string;
audience: string | null;
allowed_origins: string[];
redirect_uris: string[];
allowed_scope: string | null;
default_scope: string | null;
access_token_config: TokenConfig | null;
refresh_token_config: TokenConfig | null;
id_token_config: TokenConfig | null;
}
interface TokenConfig {
expires_in: number;
cookie_options?: {
http_only?: boolean;
secure?: boolean;
same_site?: "lax" | "strict" | "none";
};
}
プロパティ
| Property | Type | Description |
|---|---|---|
id | string | cid プレフィックス付き KSUID |
resource_id | string | Client を所有する Application または Account |
issuer | string | トークンの issuer クレーム |
audience | string? | トークンの audience クレーム |
allowed_origins | string[] | 有効な CORS オリジン |
redirect_uris | string[] | OAuth リダイレクト URL |
allowed_scope | string? | トークン要求で許可されるスコープ |
default_scope | string? | 未指定時に適用されるデフォルトスコープ |
access_token_config | object? | Access Token 設定 |
refresh_token_config | object? | Refresh Token 設定 |
id_token_config | object? | ID Token 設定 |
例
{
"id": "cid_2kHfPZcN9xW4mE8RtY7vB",
"resource_id": "app_root",
"issuer": "https://auth.example.com",
"audience": "https://api.example.com",
"allowed_origins": ["https://app.example.com"],
"redirect_uris": ["https://app.example.com/callback"],
"access_token_config": {
"expires_in": 3600
},
"refresh_token_config": {
"expires_in": 1209600
}
}
関連
- Clients - クライアント管理
- Client Key - 署名鍵
- OAuth - OAuth フロー