Skip to content

Commit 5d500d5

Browse files
authored
Merge pull request #1281 from logto-io/guamian-doc
fix: update copy and images
2 parents c492344 + d32ab3a commit 5d500d5

12 files changed

+51
-25
lines changed

docs/end-user-flows/organization-experience/create-organization.mdx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,15 @@ Create an [organization template](/authorization/organization-template) to batch
2626

2727
### Create via Logto Management API \{#create-via-logto-management-api}
2828

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.
3030

3131
:::note
3232

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:
3434

35+
<Url href="/end-user-flows/organization-experience/setup-app-service-with-management-api">
36+
Set up your app service with the Logto Management API
37+
</Url>
3538
<Url href="/concepts/core-service/#management-api">Management API</Url>
3639
<Url href="/integrate-logto/interact-with-management-api">Interact with Management API</Url>
3740

docs/end-user-flows/organization-experience/get-user-info.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This is usually used in the user profile page where users need to show their org
1414

1515
There are two ways to get user info within an organization.
1616

17-
### 1. Decode the ID token \{#1-decode-the-id-token}
17+
### Decode the ID token \{#decode-the-id-token}
1818

1919
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:
2020

@@ -55,6 +55,6 @@ logtoClient.signIn({
5555

5656
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.
5757

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}
5959

6060
You can also request `/oidc/me` to get real‑time user info in the organization context. Call the SDK method `fetchUserInfo()`.

docs/end-user-flows/organization-experience/invite-organization-members.mdx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_position: 6
44

55
# Invite organization members
66

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.
88

99
## Flow overview \{#flow-overview}
1010

@@ -87,10 +87,15 @@ There’s a set of invitation‑related Management APIs in the organizations fea
8787
- `POST /api/organization-invitations`: Create an organization invitation with an assigned organization role.
8888
- `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)
8989
- `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:
9190

92-
```json
93-
{
94-
"link": "https://your-app.com/invitation/join?id=your-invitation-id&token=your-one-time-token&email=invitee-email"
95-
}
96-
```
91+
:::note
92+
93+
The payload supports a `link` property so you can compose your own invitation link based on the invitation ID. For example:
94+
95+
:::
96+
97+
```json
98+
{
99+
"link": "https://your-app.com/invitation/join?id=your-invitation-id&token=your-one-time-token&email=invitee-email"
100+
}
101+
```

docs/end-user-flows/organization-experience/join-the-organization.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ sidebar_position: 7
66

77
## Where to use it \{#where-to-use-it}
88

9-
The organization list typically appears during the user onboarding flow. For example, when an admin invites you to join a workspace.
9+
The organization list and joining flow usually appear during user onboarding.
10+
For example, when an admin invites someone to a workspace, but the user skips the email invitation and directly signs in or signs up in the app.
1011

11-
From a product perspective, it can show up in two main places:
12+
In your product, you may want to add entry points for this flow.
13+
It can appear in two main places:
1214

1315
- The **organization finder** during sign-in or sign-up
1416

docs/end-user-flows/organization-experience/permission-and-resource-management.mdx

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,26 @@
22
sidebar_position: 8
33
---
44

5-
# Permission and resource management
5+
# Handle scope updates in organization tokens
66

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.
88

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.
1010

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.
1212

13-
With the above setup, you can send invitations via email, and invitees can join the organization with the assigned role.
13+
:::note
1414

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.
15+
<Url href="/authorization/organization-permissions">Protect organization (non-API) permissions</Url>
16+
<Url href="/authorization/organization-level-api-resources">
17+
Protect organization-level API resources
18+
</Url>
1619

17-
## 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.
1823

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}
2025

2126
Managing scope updates in organization tokens involves:
2227

docs/end-user-flows/organization-experience/setup-app-service-with-management-api.mdx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ sidebar_position: 2
44

55
# Set up your app service with the Logto Management API
66

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.
89

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.
1011

1112
## Establish a machine-to-machine connection \{#establish-a-machine-to-machine-connection}
1213

@@ -31,7 +32,7 @@ curl \
3132

3233
## Protect your app server \{#protect-your-app-server}
3334

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.
3536

3637
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.
3738

@@ -71,10 +72,20 @@ This ensures that when calling `getOrganizationToken(organizationId)`, the clien
7172

7273
For details on protecting organization‑level (non‑API) permissions, see the [full guide](/authorization/organization-permissions).
7374

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}
7576

7677
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).
7778

7879
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.
7980

8081
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).
-18.1 KB
Loading
-42.7 KB
Loading
-40.8 KB
Loading
-13.9 KB
Loading

0 commit comments

Comments
 (0)