API 資源與權限範圍(Scopes)為每個 API 分別管理權限。每個 API 擁有獨立的資源識別碼與權限集合針對特定 API 簽發訪問 token,並以 scopes 攜帶權限可為每個 API 單獨設定訪問 token 的有效期限文檔API 資源Ordervale APIIdentifierhttps://api.ordervale.comToken lifetime3600 sPermissionsread:ordersView orderswrite:ordersCreate and edit ordersdelete:ordersCancel orders
基於角色的訪問控制(RBAC)為用戶與後端服務定義角色。可跨多個 API 組合權限的全局角色為一般用戶與機器對機器應用分別設定角色為新註冊或新建立的用戶自動指派默認角色透過控制台或 Management API 指派角色文檔基於角色的訪問控制(RBAC)RoleOrder managerPermissionsread:ordersOrdervale APIwrite:ordersOrdervale APIread:invoicesBilling APIAssign to new usersAssigned toSSam ChenPPriya NairKKen Ito
組織角色與權限從單一共享模板指派不同的組織角色。所有組織共用同一套角色與權限模板同一位用戶在不同組織中可擔任不同角色用於應用內功能的組織權限,例如邀請成員限定於特定組織範圍內的 API 權限同時支持用戶與機器對機器應用的組織角色文檔組織模板組織權限組織層級 API 資源Sam Chen[email protected]Global roleOrdervaleSupportOrganization rolesAcmeAdminGlobexViewerOrganization templateinvite:membersmanage:billing
應用層級訪問控制為每個應用設定獨立的訪問規則。按用戶、全局角色、組織或特定組織中的角色設定訪問規則不符合應用規則的用戶將看到拒絕訪問頁面在刷新 token 時會再次檢查訪問規則文檔應用層級訪問控制Ordervale AdminRulesAllow sign-in forUser roleSupportOrganizationAcmeOrganization roleGlobex · AdminAccess deniedYou don't have access to Ordervale Admin.Sign in with another account
自訂 Token 聲明(Claims)將你的業務數據與內建權限一同寫入 Token。從用戶資料與組織數據加入自訂聲明,例如內部用戶 ID 或客戶方案等級可在腳本中讀取企業級 SSO 的身份數據(如目錄群組)在簽發 token 時從你自己的 API 實時獲取外部數據支持自訂驗證邏輯,必要時可拒絕簽發 token內建標準聲明維持不變文檔自訂訪問 Token常見使用場景const getCustomJwtClaims = async ({ context }) => { const org = context.organization; return { plan: org?.customData.plan, internal_org_id: org?.customData.internalId, }; };{ "aud": "https://api.ordervale.com", "scope": "read:orders write:orders", "organization_id": "org_acme", "plan": "enterprise", "internal_org_id": "acme-0042" }
API 本地 Token 驗證在本地驗證 Token,無需每次請求都調用 Logto。使用 Logto 的公鑰驗證已簽署的 JWT在你的 API 中針對每次請求檢查 scopes組織範圍的 token 會攜帶組織上下文,讓你的 API 確認請求所屬的客戶提供 Node.js、Python、Go、Java、.NET、PHP、Ruby 與 Rust 的驗證指南權限變更會於下次簽發新 token 時生效文檔驗證訪問 Token{ "iss": "https://auth.ordervale.com/oidc", "sub": "u_8k2f", "aud": "https://api.ordervale.com", "scope": "read:orders write:orders", "organization_id": "org_acme", "exp": 1760630400 }Node.jsPythonGoJava.NETPHPRubyRust