# SSO and SCIM

> Sign in to a project with your identity provider over OIDC for a verified email domain, and provision and deactivate members with SCIM 2.0. Business plan.

On the Business plan, people of your company can sign in through your identity provider, such as Microsoft Entra ID, Google Workspace or Keycloak, and your provider can add and remove members with SCIM. Galerne supports OpenID Connect (OIDC). SAML is coming soon.

## Set up OIDC

1. In your identity provider, create an OIDC application (a web app with a client secret). Set its redirect URL to `https://studio.galerne.cloud/sso/callback`; the studio shows it with a copy button.
2. In the studio, open the project **Settings**, then **SSO**, and add a connection:

| Field | What to enter |
|---|---|
| Domain | Your email domain, such as `example.com` |
| Issuer | The issuer URL of your provider, starting with `https://` |
| Client ID, client secret | From the application you created |
| Default role | The role new people get, `editor` by default |

3. Verify the domain. Add a DNS TXT record named `_galerne.example.com` with the value the studio shows, `galerne-verify=<token>`, then choose **verify**.
4. Optional: turn on **enforce**. Galerne then stops sending email sign-in codes to addresses of that domain, so people of that domain can only sign in through your provider.

Galerne reads your provider's configuration from `<issuer>/.well-known/openid-configuration`, and asks for the scopes `openid email profile` with PKCE.

## Signing in

A person enters their email address at sign-in. When its domain has a verified connection, Galerne sends them to your provider; without enforce, they can choose between SSO and an email code. On their return, Galerne checks the ID token and requires a verified email address of the domain. The first sign-in creates the account and adds the person to the project with the default role. Change roles and limits in **Settings**, **Members** as for anyone else.

## SCIM 2.0

With a verified connection, generate a SCIM token in the same settings page. It starts with `gal_scim_` and is shown once. Give your provider:

| Setting | Value |
|---|---|
| Base URL | `https://api.galerne.cloud/scim/v2` |
| Authentication | Bearer token, the `gal_scim_…` token |

| Endpoint | What it does |
|---|---|
| `GET /ServiceProviderConfig` | What the server supports |
| `GET /Users`, `GET /Users?filter=userName eq "ada@example.com"` | List users, or find one by email |
| `GET /Users/<id>` | One user |
| `POST /Users` | Add a person to the project, with the default role |
| `PATCH /Users/<id>`, `PUT /Users/<id>` | Change `active`: `false` disables the member and ends their sessions at once |
| `DELETE /Users/<id>` | Remove the member; admins are disabled instead |

Users carry `userName` (the email address, on the verified domain), `displayName`, `active` and `emails`. Groups, bulk operations and sorting are not supported.

## Roles and limits

SSO decides who signs in; roles and limits decide what each person may do. On Business, each member can be limited to some languages, document types and branches. See [agents and permissions](/docs/agents.md#roles).
