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:
- 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. - 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…). - Partner Management Plane (
/v1/partner/*): Xác thực bằngX-Partner-Client-Id&X-Partner-Client-Secret; từ chối mọi workspace token.
Tạo token trong Developer Console
Phần tiêu đề “Tạo token trong Developer Console”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ì.
OAuth 2.0 Authorization Code + PKCE (S256)
Phần tiêu đề “OAuth 2.0 Authorization Code + PKCE (S256)”- Redirect admin workspace tới
/app/oauth/public-authorize?client_id=...&redirect_uri=...&scope=...&code_challenge=...&code_challenge_method=S256&state=.... - Đổi
codelấyaccess_tokenvàrefresh_tokenquaPOST /v1/oauth/token(grant_type=authorization_code). - 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.
