# WorkOS

> Connect LearnHouse SSO through WorkOS for SAML or OIDC: set the instance credentials, then let your IT team finish setup in the WorkOS portal.

[WorkOS](https://workos.com) brokers SSO for many identity providers through one integration, over SAML or OIDC. Its hosted setup portal lets your IT team configure the identity provider connection themselves.

> WorkOS is only offered when the instance has WorkOS credentials. Without them, the provider shows as "(Not configured)" and cannot be selected.

## Instance setup (self-hosted)

Set these on the API:

| Variable | Description |
| --- | --- |
| `WORKOS_API_KEY` | Your WorkOS API key |
| `WORKOS_CLIENT_ID` | Your WorkOS Client ID |

Add LearnHouse's [callback URL](https://docs.learnhouse.app/enterprise/sso#callback-url) as a redirect URI in your WorkOS dashboard.

## Organization setup

1. Go to **Developers** → **SSO** and choose **WorkOS** as the **SSO Provider**.
2. Fill in the **WorkOS Organization ID** (`org_...`) if you have one. It is also generated automatically when you configure SSO through the setup portal.
3. Set **Enable SSO**, **Allowed Email Domains** and **Auto-provision Users** (see [SSO options](https://docs.learnhouse.app/enterprise/sso#setting-up-sso)), then click **Save Configuration**.
4. After saving, click **Configure Identity Provider**. It opens the WorkOS setup portal, where you or your IT team connect the identity provider (Okta, Microsoft Entra ID, Google Workspace, a generic SAML provider and so on).
5. Members can now use **Sign in with SSO** on your login page.

> The API also accepts a WorkOS `connection_id` instead of an organization ID, for a single specific connection. The dashboard only exposes the organization ID.
