Skip to content

Xác thực, OAuth 2.0 PKCE & Scopes

This content is not available in your language yet.

TrolyPage tách biệt chặt chẽ 3 API Planes để chống leo thang đặc quyền:

  1. Workspace Plane (tp_live_* / tp_test_* / tp_oa_*): Dùng trên server của khách hàng hoặc qua Partner App đã ủy quyền.
  2. Client Chat Plane (tp_cs_*): Token ngắn hạn cho widget trình duyệt/mobile chat ở /v1/client-sessions/*; bị chặn hoàn toàn trên mọi endpoint quản trị (/v1/customers, /v1/agents, /v1/orders…).
  3. Partner Management Plane (/v1/partner/*): Xác thực bằng X-Partner-Client-Id & X-Partner-Client-Secret; từ chối mọi workspace token.

Truy cập /app/developer trong TrolyPage Workspace để:

  • Khởi tạo tích hợp với least-privilege scopes (customers:read, orders:write, agents:execute…).
  • Giới hạn theo resource (resource_restrictions, ví dụ chỉ cho phép một AI Agent ID cụ thể).
  • Xoay token với cửa sổ ân hạn 24 giờ hoặc kích hoạt Kill Switch thu hồi tức thì.
  1. Redirect admin workspace tới /app/oauth/public-authorize?client_id=...&redirect_uri=...&scope=...&code_challenge=...&code_challenge_method=S256&state=....
  2. Đổi code lấy access_token và refresh_token qua POST /v1/oauth/token (grant_type=authorization_code).
  3. Refresh token tự động xoay mỗi lần dùng; dùng lại refresh token cũ lập tức thu hồi toàn bộ token family để bảo vệ multi-tenant.