Skip to content

Commit 247615d

Browse files
authored
docs: add opaque token and organization information (#1321)
1 parent 96bf4ce commit 247615d

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

docs/concepts/opaque-token.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,14 @@ curl --location \
5454
```
5555

5656
Remember to replace `[tenant-id]` with your tenant ID.
57+
58+
## Opaque token and organizations \{#opaque-token-and-organizations}
59+
60+
Opaque tokens can be used to retrieve organization membership information via the [userinfo endpoint](https://openid.net/specs/openid-connect-core-1_0.html#UserInfo). When you request the `urn:logto:scope:organizations` scope, the userinfo endpoint will return the user's organization-related claims, such as `organizations` (organization IDs) and `organization_data`.
61+
62+
However, **opaque tokens cannot be used as organization tokens**. Organization tokens are always issued in JWT format because:
63+
64+
1. Organization tokens contain organization-specific claims (like `organization_id` and scoped permissions) that need to be validated by resource servers.
65+
2. The JWT format allows resource servers to verify the token and extract organization context without additional API calls.
66+
67+
To obtain an organization token, you need to use the [refresh token flow](/authorization/organization-permissions#refresh-token-flow) or [client credentials flow](/authorization/organization-permissions#client-credentials-flow) with organization parameters.

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,9 @@ If the session is still valid, the `signIn` call will redirect back to your app
5858
### 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()`.
61+
62+
:::tip[Opaque token support]
63+
If you are using an [opaque token](/concepts/opaque-token) (issued when no API resource is specified), you can still retrieve organization membership information through the userinfo endpoint. When you request the `urn:logto:scope:organizations` scope, the response will include `organizations` and other organization-related claims.
64+
65+
Note that opaque tokens cannot be used as organization tokens for accessing organization-specific resources. See [Opaque token and organizations](/concepts/opaque-token#opaque-token-and-organizations) for more details.
66+
:::

docs/quick-starts/fragments/_scope-claim-list.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ Please refer to the [OpenID Connect Core 1.0](https://openid.net/specs/openid-co
6666
| organizations | `string[]` | The organization IDs the user belongs to | No |
6767
| organization_data | `object[]` | The organization data the user belongs to | Yes |
6868

69+
:::note
70+
These organization claims can also be retrieved via the userinfo endpoint when using an [opaque token](/concepts/opaque-token). However, opaque tokens cannot be used as organization tokens for accessing organization-specific resources. See [Opaque token and organizations](/concepts/opaque-token#opaque-token-and-organizations) for more details.
71+
:::
72+
6973
**`urn:logto:scope:organization_roles`**
7074

7175
| Claim name | Type | Description | Needs userinfo? |

0 commit comments

Comments
 (0)