Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/developers/custom-token-claims/create-script.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,18 @@ The context object contains the user data and grant data that relevant to the cu

- **User data object**
For user access token, Logto provides additional user data context for you to access. The user data object contains all the user profile data and organization membership data you may need to set up the custom claims. Please check [Users](/user-management/user-data) and [Organizations](/organizations/organization-management#organization-data-structure) for more details.
- **Organization data object**
For [organization access tokens](/authorization/organization-template) (an access token requested for a specific organization), Logto provides the target organization through `context.organization`, so you can attach per-organization claims—for example, mapping the Logto organization ID to an internal ID stored in the organization's custom data. This data object is only present when the token is issued for a specific organization, and contains:

| Property | Description | Type |
| ------------- | ----------------------------------- | ------------------------- |
| `id` | The unique organization id | `string` |
| `name` | The organization name | `string` |
| `description` | The organization description | `string \| null` |
| `customData` | The custom data of the organization | `Record<string, unknown>` |

Please check [Organizations](/organizations/organization-management#organization-data-structure) for more details.

- **Grant data object**
For user access token granted by impersonation token exchange, Logto provides additional grant data context for you to access. The grant data object contains the custom context from the subject token. Please check [Impersonation](/developers/user-impersonation) for more details.
- **User interaction data object**
Expand Down
Loading