AM
TH
เริ่มต้นฟรี
เมนู
ประเภท

Client

การตั้งค่า OAuth 2.0 client application สำหรับการยืนยันตัวตนและการออกโทเคน

client oauth application configuration

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";
  };
}

คุณสมบัติ

PropertyTypeคำอธิบาย
idstringKSUID ที่ขึ้นต้นด้วย cid
resource_idstringapplication หรือ account ที่เป็นเจ้าของ
issuerstringissuer claim สำหรับโทเคน
audiencestring?audience claim สำหรับโทเคน
allowed_originsstring[]CORS origins ที่อนุญาต
redirect_urisstring[]OAuth redirect URLs
allowed_scopestring?scopes ที่อนุญาตให้ร้องขอ
default_scopestring?scope ปริยายเมื่อไม่ได้ระบุ
access_token_configobject?การตั้งค่า access token
refresh_token_configobject?การตั้งค่า refresh token
id_token_configobject?การตั้งค่า 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