client_id and client_secret (Basic Auth)https://auth.aworld.cloud/oauth2/token with grant_type=client_credentialsaccess_token with configured scopesapp/read: read end-user API dataapp/write: write end-user API data (e.g., log activity on behalf of user)dashboard/read: read configurations and analyticsdashboard/write: create/modify missions, content, usersx-user-id header to specify user to impersonateauth.{CUSTOM_DOMAIN} with selective routingexpiresAt > now before return/oauth2/token → Lambda (with caching logic for client_credentials)/.well-known/openid-configuration → Lambda (cached response with URL rewriting)workspaceId in token and requested workspaceidentityId as principalIsAuthorizedWithToken API of Verified PermissionsworkspaceId, resourceId extracted from URL| Claim | Description | Security importance |
|---|---|---|
sub | Cognito user ID | Unique user identifier |
workspaceId | Workspace ID | CRITICAL: Multi-tenant isolation |
accountId | Account ID | Tenant membership |
userId | Application user ID | Application user ID |
context | "dashboard" | "app" | Authorized API context |
platform | "web" | "mobile" | "m2m" | Client type |
role | User role | RBAC permissions |
exp | Unix timestamp | Token expiration |
platform: "m2m"X-User-ID: {userId}m2mDelegation middleware intercepts header and validates:userId: User ID to impersonateprincipalId: User principal IDlang, timezone: User preferencesapp/write or dashboard/write