Skip to content

Commit 8d6d1cf

Browse files
committed
chore: document organization settings flows
1 parent a3c239f commit 8d6d1cf

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

docs/kratos/organizations/organizations.mdx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,37 @@ your system but need the identity to be created in Ory Network first, before the
261261
To achieve this, set the `organization_id` property to the ID of the created organization in the identity, either when creating
262262
the identity, or by updating the identity's data using the Ory APIs.
263263

264+
## Bind an identity to an organization through the settings flow
265+
266+
A signed-in user can join an organization by linking one of its SSO connections through the
267+
[settings flow](../self-service/flows/user-settings.mdx). When the user completes the link, Ory sets the identity's
268+
`organization_id` to that organization. There is no need to sign the user out or to pre-provision the identity.
269+
270+
To scope a settings flow to an organization, pass the organization ID in the `organization` query parameter when you initialize
271+
the flow:
272+
273+
```
274+
https://$PROJECT_SLUG.projects.oryapis.com/self-service/settings/browser?organization=$ORGANIZATION_ID
275+
```
276+
277+
The same parameter works for the API (native) flow at `/self-service/settings/api`.
278+
279+
An organization-scoped settings flow behaves differently from a regular settings flow:
280+
281+
- The flow returns link nodes only for the organization's OIDC and SAML connections. Other settings methods, such as password or
282+
social sign-in, are not part of the flow.
283+
- Connections the identity has already linked render as disabled. The organization owns the binding, so the user cannot remove it.
284+
- Submitting a link starts authentication with the organization's identity provider. On the callback, Ory links the credential and
285+
sets the identity's `organization_id`.
286+
- Unlink submissions are rejected. To remove a member from an organization, use the identity admin API.
287+
288+
When the signed-in identity is already bound to an organization, that organization takes precedence over the `organization` query
289+
parameter. An identity cannot be silently re-bound to a different organization through the settings flow.
290+
291+
If the identity's `organization_id` points to an organization that was deleted, the settings flow falls back to a regular,
292+
unscoped flow. This keeps account recovery and self-service settings working for users who were offboarded from a deleted
293+
organization.
294+
264295
## SAML
265296

266297
SAML (Security Assertion Markup Language) is an XML-based open standard used for exchanging authentication and authorization data

docs/kratos/self-service/flows/user-settings.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,14 @@ Social Sign In is not possible for API Clients. It will be possible in a future
615615

616616
:::
617617

618+
:::info
619+
620+
You can scope the settings flow to an organization by passing the `organization` query parameter. The flow then returns link nodes
621+
only for that organization's SSO connections, and linking one binds the identity to the organization. See
622+
[Bind an identity to an organization through the settings flow](../../organizations/organizations.mdx#bind-an-identity-to-an-organization-through-the-settings-flow).
623+
624+
:::
625+
618626
## Settings form validation
619627

620628
The form payloads are then submitted to Ory Identities which follows up with:

0 commit comments

Comments
 (0)