You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/end-user-flows/organization-experience/create-organization.mdx
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,12 +26,15 @@ Create an [organization template](/authorization/organization-template) to batch
26
26
27
27
### Create via Logto Management API \{#create-via-logto-management-api}
28
28
29
-
The Console is great for manual setup, but most apps let end users self‑serve—create and manage organizations directly in your app. To do that, implement these features with the Logto Management API.
29
+
The console is great for manual setup, but most apps let end users self‑serve—create and manage organizations directly in your app. To do that, implement these features with the Logto Management API.
30
30
31
31
:::note
32
32
33
-
If you’re new to the Logto Management API, read these first:
33
+
If you’re new to the Logto Management API or haven't read the basic intro of using Logto Management API for organization experience, read these first:
Copy file name to clipboardExpand all lines: docs/end-user-flows/organization-experience/get-user-info.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ This is usually used in the user profile page where users need to show their org
14
14
15
15
There are two ways to get user info within an organization.
16
16
17
-
### 1. Decode the ID token \{#1-decode-the-id-token}
17
+
### Decode the ID token \{#decode-the-id-token}
18
18
19
19
The ID token is a standard JWT that contains user profile information and organization‑related claims. Call the SDK method `decodeIdToken()` to get a JSON object like this:
20
20
@@ -55,6 +55,6 @@ logtoClient.signIn({
55
55
56
56
If the session is still valid, the `signIn` call will redirect back to your app without requiring credentials. From the user’s perspective, the app simply refreshes and a new ID token is issued behind the scenes.
57
57
58
-
### 2. Fetch user info from the `/oidc/me` endpoint \{#2-fetch-user-info-from-the-oidc-me-endpoint}
58
+
### Fetch user info from the `/oidc/me` endpoint \{#fetch-user-info-from-the-oidc-me-endpoint}
59
59
60
60
You can also request `/oidc/me` to get real‑time user info in the organization context. Call the SDK method `fetchUserInfo()`.
Copy file name to clipboardExpand all lines: docs/end-user-flows/organization-experience/invite-organization-members.mdx
+12-7Lines changed: 12 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ sidebar_position: 6
4
4
5
5
# Invite organization members
6
6
7
-
In multi‑organization applications, a common requirement is inviting members to an organization. This guide walks through the steps and technical details to implement this feature.
7
+
In multi‑tenancy applications, a common requirement is inviting members to an organization. This guide walks through the steps and technical details to implement this feature.
8
8
9
9
## Flow overview \{#flow-overview}
10
10
@@ -87,10 +87,15 @@ There’s a set of invitation‑related Management APIs in the organizations fea
87
87
-`POST /api/organization-invitations`: Create an organization invitation with an assigned organization role.
88
88
-`POST /api/one-time-tokens`: Create a one‑time token for the invitee to authenticate when they accept the invitation. [Learn more](/end-user-flows/one-time-token)
89
89
-`POST /api/organization-invitations/{id}/message`: Send the organization invitation to the invitee via email.
90
-
Note: The payload supports a `link` property so you can compose your own invitation link based on the invitation ID. For example:
Copy file name to clipboardExpand all lines: docs/end-user-flows/organization-experience/permission-and-resource-management.mdx
+13-8Lines changed: 13 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,21 +2,26 @@
2
2
sidebar_position: 8
3
3
---
4
4
5
-
# Permission and resource management
5
+
# Handle scope updates in organization tokens
6
6
7
-
Use the organization as a resource and apply an organization template to protect it. For example, each organization has its own documents within a tenant. Only users with the right roles can edit or delete those documents.
7
+
With the above setup, you can send invitations via email, and invitees can join the organization with the assigned role.
8
8
9
-
See [Organization permissions](/authorization/organization-permissions)for details.
9
+
Users with different organization roles will have different scopes (permissions) in their organization tokens. Both your client app and backend services should check these scopes to determine visible features and permitted actions.
10
10
11
-
## Use organization role-based access control (RBAC) to manage user permissions\{#use-organization-role-based-access-control-rbac-to-manage-user-permissions}
11
+
As mentioned earlier, the organization template serves as a key access control layer to protect [organization permissions](/authorization/organization-permissions) or [organization-level APIs](/authorization/organization-level-api-resources). Be sure to review the authorization sections and choose the authorization model that best fits your product.
12
12
13
-
With the above setup, you can send invitations via email, and invitees can join the organization with the assigned role.
13
+
:::note
14
14
15
-
Users with different organization roles will have different scopes (permissions) in their organization tokens. Both your client app and backend services should check these scopes to determine visible features and permitted actions.
## Handle scope updates in organization tokens \{#handle-scope-updates-in-organization-tokens}
20
+
:::
21
+
22
+
This chapter focuses on **permission management** and best practices for **handling scope changes and permissions** in Logto organization tokens.
18
23
19
-
This section covers advanced topics about managing the organization template and authorization scenarios. If you’re not familiar with these concepts, read [Authorization](/authorization) and [Organization template](/authorization/organization-template) first.
24
+
## Handle scope updates in organization tokens \{#handle-scope-updates-in-organization-tokens}
20
25
21
26
Managing scope updates in organization tokens involves:
Copy file name to clipboardExpand all lines: docs/end-user-flows/organization-experience/setup-app-service-with-management-api.mdx
+15-4Lines changed: 15 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,10 @@ sidebar_position: 2
4
4
5
5
# Set up your app service with the Logto Management API
6
6
7
-
Use the Logto **Management API** to build custom **organization flows** in your app. Below are the basic setup steps for integrating the Management API. If you’re already familiar, you can skip ahead to the [tutorial](/integrate-logto/interact-with-management-api).
7
+
Logto offers a powerful Management API that lets you create and customize your own organization flow inside your app.
8
+
Understanding how it works is key to designing your custom setup. Below are the basic steps and outline to integrate the Management API to implement your organization experience.
8
9
9
-
Once you’re familiar with the setup, you can explore additional APIs to tailor the rest of the flows to your business needs.
10
+
If you already know the basics, you can skip ahead to the [tutorial](/integrate-logto/interact-with-management-api). Once you’re familiar with the setup, you can explore additional APIs to tailor the rest of the flows to your business needs.
10
11
11
12
## Establish a machine-to-machine connection \{#establish-a-machine-to-machine-connection}
12
13
@@ -31,7 +32,7 @@ curl \
31
32
32
33
## Protect your app server \{#protect-your-app-server}
33
34
34
-
Because end users can perform certain organization operations self‑serve, add an authorization layer between the end user and your app server.The server should mediate every request, validate the user’s organization‑scoped token and required scopes, and only then use a server‑held M2M credential to invoke the Management API.
35
+
Since end users can perform certain organization actions on their own, it’s important to add an authorization layer between the end user and your app server.\You can apply this layer globally or at the organization level, depending on which Logto Management API endpoints you use and how your product’s API is structured.The server should mediate every request, validate the user’s organization‑scoped token and required scopes, and only then use a server‑held M2M credential to invoke the Management API.
35
36
36
37
When a user presents an organization token to request an action (for example, creating an organization), the server first validates the scopes in the token. If the token includes the necessary scope, such as `org:create`, authorize the request and call the Logto Management API via the M2M flow to create the organization.
37
38
@@ -71,10 +72,20 @@ This ensures that when calling `getOrganizationToken(organizationId)`, the clien
71
72
72
73
For details on protecting organization‑level (non‑API) permissions, see the [full guide](/authorization/organization-permissions).
73
74
74
-
### Mixing organization-level permissions and API-level permissions \{#mixing-organization-level-permissions-and-api-level-permissions}
75
+
### Using API-level permissions \{#using-api-level-permissions}
75
76
76
77
This applies when your API resources and permissions are registered globally, but roles are defined at the organization level (you can assign API‑level permissions to organization roles in the organization template).
77
78
78
79
The implementation is the same as the previous section. Always provide the organization ID and call `getOrganizationToken(organizationId)` to fetch an organization token; otherwise, organization permissions won’t be included.
79
80
80
81
For details on protecting organization‑level API permissions, see the [full guide](/authorization/organization-level-api-resources).
82
+
83
+
### Using global RBAC
84
+
85
+
In this case, you can use the Logto Management API to implement system-level access control.
86
+
87
+
In a multi-tenant environment, a common pattern is to have a superuser or super admin role. For example, if you’re building a SaaS platform with Logto, you might want a superuser who can manage all client organizations directly within your own app, without needing to log in to the Logto Console.
88
+
89
+
This superuser can perform higher-level actions, such as creating or deleting organizations in bulk, that require system, wide permissions beyond any single organization context. To enable this, register an API resource in Logto while levergaing the Logto Management API and use global RBAC to manage these permissions.
90
+
91
+
For more details on integrating and managing access control for RBAC, see the full guide see the [full guide](/authorization/global-api-resources).
0 commit comments