Client
Client คือแอปพลิเคชัน OAuth 2.0 ที่ใช้ยืนยันตัวตนผู้ใช้และร้องขอโทเคน โดยกำหนด allowed origins, redirect URIs และการตั้งค่าโทเคนไว้
สคีมา
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 | คำอธิบาย |
|---|---|---|
id | string | KSUID ที่ขึ้นต้นด้วย cid |
resource_id | string | application หรือ account ที่เป็นเจ้าของ |
issuer | string | issuer claim สำหรับโทเคน |
audience | string? | audience claim สำหรับโทเคน |
allowed_origins | string[] | CORS origins ที่อนุญาต |
redirect_uris | string[] | OAuth redirect URLs |
allowed_scope | string? | scopes ที่อนุญาตให้ร้องขอ |
default_scope | string? | scope ปริยายเมื่อไม่ได้ระบุ |
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 flows