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