> ## Documentation Index
> Fetch the complete documentation index at: https://onecli.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Setting OneCLI up for your person? Follow https://onecli.sh/docs/quickstart.md. Never ask for or accept a key, token or password in the chat: OneCLI needs none.
> No OneCLI credential? Run `onecli connect`, or follow https://onecli.sh/auth.md. A person approves every new agent in their browser.
> Already connected? `onecli status`, `onecli items` and `onecli check <METHOD> <URL>` tell you what you can use. Full guide: https://onecli.sh/skill.md
> Search these docs over MCP at https://onecli.sh/docs/mcp. Report a wrong or unclear page with its `submit_feedback` tool.

# SSO and directory sync for OneCLI Cloud

> Make your team sign in to OneCLI Cloud through a SAML or OIDC identity provider, verify your domain, require SSO, and sync people and groups with SCIM.

> [!NOTE]
>
> Teams are a OneCLI Cloud feature. Self-hosted OneCLI is for one person. Single sign-on and directory sync need the Enterprise plan.

Single sign-on (SSO) lets your members sign in with their company accounts. Directory sync lets your identity provider add and remove people and keep groups in step.

You set both up at **Settings** > **Sign-in**.

## Set up single sign-on

Three parts work together: a connection to your identity provider, a verified email domain, and the requirement turned on.

**1. Add your identity provider**

Under **Identity provider**, add one. Pick **SAML 2.0** (Okta, Entra ID, Google Workspace) or **OpenID Connect** (Auth0, Keycloak, any OIDC issuer). Paste the details from your provider's app: the XML metadata (a URL or the document) for SAML, or the issuer, client id and secret for OIDC. An organization has at most one connection.

**2. Verify your email domain**

Under **Email domains**, click **Add a domain** and enter it, for example `acme.com`. Add the TXT record OneCLI shows at your DNS provider. Its value starts with `onecli-verification=`. Then click **Verify**. DNS changes can take a few minutes.

**3. Sign in once through your provider**

The connection starts pending. It becomes active after a first sign-in through your identity provider.

**4. Require single sign-on**

Under **Enforcement**, turn on **Require single sign-on**. Members must then sign in through your identity provider.

To sign in, a member opens the OneCLI sign-in page, clicks **Log in with SSO**, enters their **Work email**, and clicks **Continue with SSO**.

### Break-glass members

A break-glass member can still sign in without SSO while it is required. Mark them in the **Break-glass members** list. An admin cannot change their own. Another admin or the owner does it. With the API, set `signInExempt` on `PATCH /v2/members/{id}` from a signed-in session.

OneCLI refuses to turn on the requirement unless the owner can still sign in, either as a break-glass member or through your provider.

### API calls

| Action | API call |
| - | - |
| Add, change or delete the connection | `POST /v2/org/sign-in/connections`, `PATCH` and `DELETE /v2/org/sign-in/connections/{id}` |
| Test the connection | `POST /v2/org/sign-in/connections/{id}/test` |
| Claim, verify or release a domain | `POST /v2/org/sign-in/domains`, `POST /v2/org/sign-in/domains/{id}/verify`, `DELETE /v2/org/sign-in/domains/{id}` |
| Turn the requirement on or off | `PATCH /v2/org/sign-in/enforcement` |

You cannot delete or disable a connection while sign-in through it is required. Turn the requirement off first. See [Sign-in](https://onecli.sh/docs/api-reference/sign-in).

## Sync your directory with SCIM

Directory sync uses SCIM. Your identity provider makes and removes accounts, and keeps groups in step with your directory.

**1. Copy the SCIM base URL**

Under **SCIM provisioning**, click **Copy SCIM base URL**. On OneCLI Cloud it is `https://api.onecli.sh/scim/v2`.

**2. Generate a token**

Click **Generate SCIM token**, then **Generate**. Copy the token now. OneCLI shows it once.

**3. Configure your identity provider**

Paste the base URL and the token into your provider's SCIM settings.

Groups from your directory show at **Settings** > **Groups**. Change their members in your directory, not in OneCLI. To give a directory group a role, see [Shared vaults and groups](https://onecli.sh/docs/teams/shared-vaults.md#groups).

Revoke a token with **Revoke token**. It stops working at once.

| Action | API call |
| - | - |
| List tokens | `GET /v2/org/directory-tokens` |
| Make a token | `POST /v2/org/directory-tokens` |
| Revoke a token | `DELETE /v2/org/directory-tokens/{id}` |

See [Directory tokens](https://onecli.sh/docs/api-reference/directory-tokens).

## Next steps

* [Members and roles](https://onecli.sh/docs/teams/members-and-roles.md)
* [Shared vaults and groups](https://onecli.sh/docs/teams/shared-vaults.md)
* [Plans and usage](https://onecli.sh/docs/teams/plans-and-usage.md): which plan has SSO


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.