
# Company sign-in (SSO) and SCIM

> **Preview.** Company sign-in is being validated with real Google Workspace, Okta and Entra tenants. Details may change.

Company sign-in lets your identity provider run membership: people at your verified domains sign in through Google Workspace, Okta, Entra ID or another SAML or OIDC provider, and groups decide roles. An owner sets it up under **Settings > Identity**. Success is **Company sign-in · &lt;provider&gt;** marked **In force**.

Nothing changes for anyone until the last of five steps, **Turn on**.

## Do it in the console

An owner changes this, in any organization except a Personal one.

1. In the organization, open **Settings** > **Identity** (`/console/o/<slug>/identity`).
2. Under **1 · Email domains**, verify a domain ([Setting up an organization](/docs/owners/setting-up-an-organization.md)).
3. Under **2 · Company sign-in**, pick the provider and click **Connect**. For **Other: SAML 2.0** or **Other: OIDC**, fill in **Name, for Other** first.

## Steps

Until step 5 the organization stays in manual mode, so a misconfigured provider locks nobody out. The badge goes **Setting up**, **Proven, not confirmed**, **In force**.

| Step on the page | What you do |
|---|---|
| 1. Configure &lt;provider&gt; | Swap values with the provider as the page shows, assign the app to its people, **Save**. |
| 2. Name the [break-glass owners](/docs/owners/members-roles-invites-join-requests.md#provisioned-organizations-and-break-glass-owners) | Tick one to three owners, each at a verified domain, and **Save**. |
| 3. Say who is in | **Connect SCIM** ([SCIM](#scim)), or **Map a group to a role** > **Map**. |
| 4. Prove it | **Sign in through &lt;provider&gt; now**, as the owner who connected it, from a verified domain, until it shows **Proven by &lt;address&gt;**. |
| 5. Confirm | **Turn on**. Without SCIM, your last sign-in must have put you in a group mapped to owner. |

## How it works

### Providers

| Choice | Protocol | SCIM | You paste back |
|---|---|---|---|
| Google Workspace | SAML | No | **SSO URL**, **Entity ID** and the certificate (no metadata URL) |
| Okta | SAML | Yes | **Metadata URL**, from the app's **Sign On** tab |
| Microsoft Entra ID | SAML | Yes | **App Federation Metadata Url**, under **SAML Certificates** |
| Other: SAML 2.0 | SAML | Yes | A **Metadata URL**, or SSO URL, entity ID and certificate; **Attribute names** (blank: `first_name`, `last_name`, `groups`) |
| Other: OIDC | OIDC | Yes | Client id, client secret (write-only), issuer URL, groups claim name |

### Group mappings

A member's role is the highest their mapped groups give; anyone in no mapped group is a builder, so you manage roles by mapping groups. Mappings match the group value or name sent, ignoring case: names for Google and Okta, both Object ID and name for Entra ID. Before turning on, **Last sign-in through &lt;provider&gt;** shows the groups sent and their role, and flags an Entra group overage claim (over 150 groups), which no mapping matches.

### Session length and removals

**Session length** is 1, 4, 8 or 12 hours, or 1, 3, 7 or 14 days (default 12 hours); shortening it ends older sessions.

**When someone is removed at &lt;provider&gt;**: with SCIM, the console drops them within a minute of the removal reaching Stytch, plus the provider's delay (Okta: moments; Entra ID: about 40-minute cycles), and apps behind Agent Cloud sign-in a minute later. Without SCIM, it waits for the provider to refuse their next sign-in, so keep the session length short for Google Workspace. Other apps drop them within their own session, a day at most.

### SCIM

**Connect SCIM**, under **Provisioning (SCIM)**, shows a **Base URL** and a **Token**, the token only once. For Entra ID, use the base URL as the **Tenant URL** exactly, query string included.

Agent Cloud pulls changes every minute. One sync removes at most 3 people or 20% of SCIM's members, whichever is more. A bigger drop is held as a likely bad answer, so press **Sync now** if it was real. **Rotate token** keeps the old token working until **Finish rotation** (or **Cancel**). **Remove SCIM** is refused while in force unless a group mapping is left.

### Once it's in force

Addresses at your domains sign in only through the provider or a break-glass email link, and invites, the join prompt and join requests switch off. A break-glass owner gets that link from the sign-in page's **Emergency access** link, then **Send emergency email link**; it works while the provider is down, and each use is logged `sso.bypass` and emailed to every owner. Members the provider doesn't know go on **Reconcile** for 30 days, then are deactivated. **Keep as exception** lets one keep signing in with Google, GitHub or an email link, with a role you set in Members, or **Remove**.

## Console sessions

A console session keeps a person signed in to the console in one browser: 14 days after Google, GitHub or an email link, or the organization's session length after company sign-in or a break-glass link. You're signed in correctly when the console opens the page you asked for without a detour to `/auth/sso/<slug>`.

Each Stytch member session stays in the Stytch organization it was made in: "Agent Cloud console", or your organization's own. Sign in on **Sign in to your console** with your **Work email** (a company address opens its sign-in; any other gets an email link, which opens in any browser after one press of **Sign in as**; **Email me a code instead** sends a 6-digit code to type in the browser that asked) or **Continue with Google** or **GitHub**. Sign out from your address at the bottom of the left menu. **Settings** > **Members** shows each person's **Last sign-in** and how. One session covers all your organizations, whose pages live under `/console/o/<slug>/…`, so two tabs can show two; `/console` opens the last one. If Stytch is down you stay signed in. Cookies: [Console sessions and cookies](/docs/security/web-security-for-the-console-and-apps.md#console-sessions-and-cookies).

### Provisioned organizations open only through their own sign-in

Once a provider is in force, people at its domains need its session, or a break-glass link, to open or decide anything in the organization, change **Identity**, or claim an app, connect an agent or change an agent's purpose there. Other sessions go to `/auth/sso/<slug>` and back, query included, or straight there if it's the person's only organization. Revoking an agent, exceptions at other domains and setup don't need it.

### What ends a session

| Event | What ends |
|---|---|
| Its length runs out | That session |
| **Sign out** | This browser's session, here and at Stytch, at once, even if Stytch is unreachable |
| A shorter session length | Older sessions from that provider |
| Removal from an organization with a provider, or SCIM deactivation | Your sessions in it, at once (without a provider, only page access) |
| Losing break-glass | Your break-glass sessions, from the next request |

Agents use tokens, never cookies, so signing out doesn't end one; removal revokes that person's agents there ([Managing agents](/docs/owners/managing-agents.md)). App users have their own sessions ([Agent Cloud sign-in](/docs/build/choosing-a-sign-in-shape.md#agent-cloud-sign-in-shape-2)). Each sign-in is recorded with who, how, the provider's name for them and when.

## Errors

Console messages, with no exit code (the production-login one is on [Console database access](/docs/data/reading-production-safely.md#console-database-access)).

| Message | Fix |
|---|---|
| Give the group’s name too, as Entra shows it: … | Fill in both name and object ID. |
| Not yet: &lt;what's missing&gt;. | Finish the listed steps. |
| Your own sign-in through the provider put you in no group mapped to owner. … | Map your group to owner; sign in again. |
| Map a group to a role first: … | Add a mapping before **Remove SCIM**. |
| The sign-in through &lt;provider&gt; didn’t go through: … | Often an address outside your domains; prove again. |
| Sign-in is briefly unavailable | Reload soon. |
| This sign-in started in another browser or expired. … | Finish in one browser within 30 minutes. |
| A link was just sent to that address. … | Wait a minute. |
| &lt;Organization&gt; signs in through &lt;provider&gt;. … | Sign in at `/auth/sso/<slug>`. |
| A company sign-in is already under way in this browser. … | Finish that one. |
| The form was stale. … | Its CSRF token didn't match; reload. |

## Limits

| Limit | Value |
|---|---|
| Providers per organization | 1 |
| Finishing a sign-in | 30 minutes, same browser |
| Email links | 1 per address per minute |
| Name for an Other provider | 60 characters |

## Related

- [Setting up an organization](/docs/owners/setting-up-an-organization.md)
- [Members, roles, invites, join requests](/docs/owners/members-roles-invites-join-requests.md)
- [Audiences: who can open an app](/docs/build/the-edge-gate.md#audiences-who-can-open-an-app)
- [Web security for the console and apps](/docs/security/web-security-for-the-console-and-apps.md)

<!-- feedback:start -->
---
Wrong, outdated or unclear? Run `agc feedback docs "owners/company-sign-in-and-scim: <what is wrong>" --body <file>` with the sentence quoted in the file. No code or app data is sent.
<!-- feedback:end -->
