# Connect your company SSO

> Set up company sign-in using your existing identity provider.

Source: https://diakrin.com/docs/sso

An organization owner or IT admin can connect a SAML 2.0 identity provider in **Settings → Sign-in**. Providers include Okta, Microsoft Entra ID, Google Workspace and OneLogin. For an operator-managed OIDC connection, contact Diakrin onboarding.

```diagram sso-sequence
Your identity provider proves who the employee is. Diakrin then decides what they can access, based on membership in your organization.
```

> [!SELF-HOSTED]
> Self-hosted installations do not use this flow. People sign in with local accounts, and an administrator can add one company OIDC connection in the installation's configuration. Each OIDC subject must be assigned to an account; a matching email never links accounts on its own. Employees then choose **Company SSO** on the sign-in page.

## SSO setup at a glance

```steps
Verify a domain | Organization owner or IT admin | Add your work-email domain in Settings → Sign-in → Domains and verify its DNS TXT record.
Create the app | Identity administrator | Copy the ACS URL and Entity ID from SSO identity provider. Configure a stable subject, map the work email to email and assign a pilot user.
Connect | Organization owner or IT admin | Paste your IdP metadata URL or upload the XML file and select Verify and connect.
Pilot, then roll out | Identity administrator | Enable company SSO in Sign-in methods and run the [pilot checklist](/docs/sso/testing) before enforcing SSO.
```

## Choose your provider

| Identity provider | Configuration guide |
| --- | --- |
| Okta | [OIDC (recommended) or SAML](/docs/sso/okta) |
| Microsoft Entra ID / Azure AD | [Create a SAML enterprise application](/docs/sso/microsoft-entra) |
| Google Workspace | [Create a custom SAML app](/docs/sso/google-workspace) |
| OneLogin | [Use the advanced SAML connector](/docs/sso/onelogin) |
| Auth0 | [Use the SAML2 Web App add-on](/docs/sso/auth0) |
| PingOne | [Configure a SAML application](/docs/sso/pingone) |
| Keycloak | [Create a SAML client](/docs/sso/keycloak) |
| Another SAML provider, including AD FS or PingFederate | [Use the common SAML checklist](/docs/sso/generic-saml) |
| Another OIDC provider | [Use the OIDC values below](#connect-with-oidc) |

Every connection still requires activation and a pilot.

## Get your setup packet

Copy the SAML values from **Settings → Sign-in → SSO identity provider** in the environment you want to connect. For OIDC, request the redirect URI from your Diakrin onboarding contact.

| Value from Diakrin | Value | Where you use it |
| --- | --- | --- |
| OIDC redirect URI | `https://auth.diakrin.com/oauth2/idpresponse` | The sign-in redirect (callback) URI of an OIDC app |
| SAML ACS / Reply URL | `https://auth.diakrin.com/saml2/idpresponse` | Where the identity provider sends the signed SAML response |
| SAML Audience / SP Entity ID | `urn:amazon:cognito:sp:<poolId>` | Identifies Diakrin's sign-in service |
| Console sign-in URL | `https://app.diakrin.com` | Where employees start sign-in |

When you read this page signed in at app.diakrin.com/docs, the setup values worksheet below shows each exact value with a copy button, including the full SAML Entity ID. Use the values under **New sign-in** for a new connection. Do not substitute the console home page for the ACS URL. Treat staging and production as separate setups.

## Connect with OIDC

Use these values for any OIDC provider without its own guide. Okta has a [preset](/docs/sso/okta#connect-with-oidc-recommended).

| Setting | Value |
| --- | --- |
| Application type | Web application, confidential client |
| Grant type | Authorization code |
| Redirect URI | `https://auth.diakrin.com/oauth2/idpresponse` |
| Scopes | `openid email` |
| Client authentication | Client secret |
| Subject (`sub`) | The provider's immutable user id, never an email |
| Email claim | `email`, the work email |

Return the issuer URL and the client ID to your onboarding contact. The issuer must publish its discovery document at `<issuer>/.well-known/openid-configuration`.

| Provider | Issuer |
| --- | --- |
| Microsoft Entra ID | `https://login.microsoftonline.com/<tenant-id>/v2.0` |
| OneLogin | `https://<subdomain>.onelogin.com/oidc/2` |

Google Workspace connects through SAML; follow [Google Workspace](/docs/sso/google-workspace).

> [!WARNING]
> The client secret goes only to the Diakrin operator, through the secure channel your onboarding contact gives you. Never paste it into email, a chat, a ticket, a prompt or a file. Stop here until your onboarding contact confirms they received it.

## Configure and return the metadata

For SAML, follow your provider guide with the setup values.

1. Send a **Persistent** NameID built from the provider's immutable user id. An email or login name can pass to a new employee, who would then sign in as the person who had it before.
2. Send the employee's work email as an attribute named `email`. If your provider cannot use that name, tell your onboarding contact the exact attribute name.
3. Assign only the pilot users or a pilot group. Apply your company's MFA policy in the identity provider.
4. In **SSO identity provider**, paste the metadata URL or select **Use XML file**. Select **Verify and connect**.
5. When the provider shows **Connected**, enable company SSO and follow [Test and roll out SSO](/docs/sso/testing).

Metadata includes public configuration and a public signing certificate. Never share private signing keys, user passwords, client secrets, session tokens or raw login assertions. Diakrin does not map any email-verification claim from your provider; do not add one.

## Prove your domains

A work email reaches your connection only when you have proved you control its domain. Owners and IT admins do this themselves under **Settings → Sign-in → Domains** (also in **Get started → Single sign-on**). A connection needs at least one verified domain.

1. Enter the domain, for example `acme.com`, and select **Add domain**. Diakrin shows a TXT value that starts with `diakrin-sso-proof=`. It is shown once; adding the domain again gives a new one.
2. Publish it as a TXT record at `_diakrin-sso.<domain>`, for example `_diakrin-sso.acme.com`. Each subdomain is a separate domain with its own record.
3. Select **Verify**. You can check a domain up to 10 times an hour.

Check the record before you verify:

```sh
dig +short TXT _diakrin-sso.acme.com
```

You should see one line with the `diakrin-sso-proof=` value you published.

Keep the record in place. Diakrin checks every verified domain again each day; when the record is gone or different, the domain lapses and its emails return to the normal sign-in. Public email domains such as `gmail.com` cannot be proved. Only one organization can hold a domain verified; a domain you have only added reserves nothing. While company SSO is enforced, a verified domain cannot be removed: turn enforcement off first.

## Turn company SSO on, and enforce it

Under **Settings → Sign-in**, owners and IT admins have two checkboxes. They stay disabled until a domain is verified and your connection is active.

- **Enable company SSO**: people on your verified domains can sign in with your provider. Unchecking it pauses SSO without deleting the connection: sign-in through your provider is refused until you enable it again.
- **Enforce company SSO — members can sign in only with SSO**: available only while Enable is checked. In your organization, only sessions signed in with your company SSO work; a password or Google session, even an owner's, is refused there with "Your organization requires company SSO". The same session still works in another organization the person belongs to. New invitations must use an email on a verified domain.

Before you enforce:

- Sign in with your company SSO yourself. Enforcing from a password or Google session is refused, so you cannot lock yourself out.
- Diakrin lists the members and invitations whose emails are outside your verified domains. They cannot sign in to your organization once SSO is enforced. Confirm the list to enforce anyway.

If your provider stops working or a domain lapses while SSO is enforced, the organization stays enforced (nothing turns password sign-in back on by itself) and Diakrin's operators are alerted. Contact Diakrin support: an operator unlocks it on your written request. There is no owner override.

CLI sessions and AI assistant connections follow the same rule: one approved from a password or Google session is refused in an organization that enforces SSO. Approve it again after signing in with SSO.

## Sign in and join your team

Your SSO connection signs in people who are already members of your organization. It never creates an account or a membership.

1. [Invite the person](/docs/team#invite-a-colleague) with their work email and wait until they accept with their current sign-in method.
2. They open the console, choose **Sign in with company SSO**, enter their work email and select **Continue with SSO**.
3. They complete your provider's sign-in and return to Diakrin. Their SSO identity is now linked to their existing account.

A first SSO sign-in is refused when the person is not a member of your organization, belongs to another organization as well, or has a different email in Diakrin. A person who joined in the last hour may be refused once; they can retry after an hour. Once membership in your organization ends, SSO sign-in is refused.

Your email domain routes sign-in to your connection; it does not grant access to an organization. Provider groups do not become Diakrin roles. To add and remove members automatically, set up [SCIM provisioning](/docs/provisioning). The **Sign in another way** option stays available on the sign-in screen.

## Existing accounts and recovery

The person keeps their existing account: SSO links to it and their password or Google sign-in still works. Before you require SSO, follow the [account migration checks](/docs/sso/testing#existing-account-migration). Keep an agreed recovery owner available until the pilot succeeds.

Ask your onboarding contact to confirm SSO availability and any applicable commercial terms before rollout. Employees do not need access to the underlying sign-in service's administration console.

## Signing in to apps

Once SSO works for the console, employees use the same sign-in for deployed company apps. Diakrin brokers the sign-in, so you do not register each app with your identity provider. Company SSO is switched only under **Settings → Sign-in**: enabling it adds company SSO to your sign-in policy, and enforcing it makes company SSO the only method, for the console and every app. See [Sign in to company apps](/docs/app-signin).

## Sign-in policy

**Settings → Sign-in policy** says how your people sign in to Diakrin and to the apps you deploy. It shows the Company SSO state read-only ("Company SSO: Off / On / Enforced — manage in Company SSO"). Its **Google** and **Email and password** choices apply to the console too: a person whose sign-in method your organization does not allow is refused in your organization with "Your organization does not allow this sign-in method". With **Only Google accounts on your verified domains**, a Google sign-in counts only when its email is on one of your verified domains (it needs at least one verified domain). At least one method stays allowed, and you cannot save a policy that would refuse your own current session. Until an admin saves a policy, every method is allowed. Workspace and app policies can only tighten it for their apps.

## If it fails

| Symptom | Cause | Fix |
| --- | --- | --- |
| The work email goes to the normal sign-in | The domain is not verified, its TXT record lapsed, or the connection is not active | Check `_diakrin-sso.<domain>` and ask your onboarding contact |
| The provider reports a redirect, audience or destination mismatch | A setup value differs | Compare each value character by character, with no trailing slash |
| The provider succeeds but Diakrin refuses the sign-in | The person is not a member yet, joined in the last hour, uses a different email in Diakrin, or belongs to another organization | Invite them and wait for acceptance, retry after an hour, or ask your onboarding contact |
| A person who left is refused | Their membership ended | Expected; remove them from your provider too |
