# Single sign-on

> Connect a SAML identity provider so people at your company sign in with their work account.

Source: https://docs.ligament.ai/guides/identity/sso/

Single sign-on (SSO) lets your staff sign in to Ligament through your company’s identity provider (IdP), such as Microsoft Entra ID, Okta or Google Workspace. Set it up when you want your IdP, not Ligament, to decide who can sign in and how. Ligament is the SAML 2.0 service provider: it trusts what your IdP asserts about a person.

SSO is configured per workspace, in **Settings › Single sign-on**, and only workspace admins can see that page. One workspace can use SSO while others keep email sign-in.

## Before you start

-   Verify your email domain first. Ligament only accepts an identity provider for a domain your workspace has proved it owns, in **Settings › Domains**. See [Verified domains](https://docs.ligament.ai/guides/identity/domains/index.md).
-   You need admin rights in your IdP to create an enterprise application.
-   Decide which role newcomers get. People who sign in for the first time join with the default role you set on the verified domain.

## How the setup fits together

SAML is an exchange of identifiers in both directions:

| From | Value | Where you find it |
| --- | --- | --- |
| Ligament | SP Entity ID: `https://app.ligament.ai/api/auth/sso/saml2/sp/metadata` | Settings › Single sign-on › Service provider details |
| Ligament | ACS / Reply URL: `https://app.ligament.ai/api/auth/sso/saml2/sp/acs/<providerId>` | On each configured provider, after you add it |
| Ligament | SP metadata URL: `https://app.ligament.ai/api/auth/sso/saml2/sp/metadata?providerId=<providerId>` | On each configured provider |
| Your IdP | IdP Entity ID (issuer), SSO URL, signing certificate | The IdP’s federation metadata XML |

The ACS URL contains a `providerId` that Ligament generates when you add the provider, so you create the app in your IdP first, add it to Ligament, then go back to the IdP to paste the ACS URL.

## Set up SSO with Microsoft Entra ID

The steps below use Entra ID. Other SAML providers follow the same order; the field names differ.

1.  In the Entra admin centre, open **Enterprise applications › New application › Create your own application**. Choose **Integrate any other application you don’t find in the gallery (Non-gallery)**, name it (for example “Ligament”) and select **Create**.
    
2.  In the new app, open **Single sign-on** and choose **SAML**. Under **SAML Certificates**, download the **Federation Metadata XML**.
    
3.  In Ligament, open **Settings › Single sign-on**. Under **Add a SAML identity provider**, enter your verified **Email domain** (for example `northwind-example.com`) and paste the metadata XML into **IdP metadata XML**. The XML fills the IdP Entity ID, SSO URL and certificate for you. You can also type those three fields by hand.
    
4.  Select **Add provider**. The provider appears under **Configured providers** with its own **ACS / Reply URL** and **SP metadata URL**.
    
5.  Back in Entra, open **Basic SAML Configuration › Edit** and set:
    
    -   **Identifier (Entity ID)**: the SP Entity ID, `https://app.ligament.ai/api/auth/sso/saml2/sp/metadata`
    -   **Reply URL (Assertion Consumer Service URL)**: the provider’s ACS / Reply URL, ending in `/sp/acs/<providerId>`
    
    Leave Sign on URL, Relay State and Logout URL empty, then save.
    
6.  Check which email address Entra sends (see [Attributes and claims](#attributes-and-claims) below).
    
7.  Under **Users and groups**, assign the people or groups who should be able to sign in.
    

\[Screenshot: The Add a SAML identity provider form in Settings › Single sign-on, with the Email domain, IdP metadata XML, IdP Entity ID, IdP SSO URL and IdP signing certificate fields\]

If you add the provider before the domain is verified, Ligament refuses it with “Verify northwind-example.com under Settings → Domains before adding an SSO provider for it”.

**Caution**

Paste the **ACS / Reply URL** into Entra’s Reply URL, not the SP metadata URL. The two look alike on the settings page. Entra reports a wrong reply URL as error `AADSTS50011`.

## Attributes and claims

Ligament requires the IdP to sign its assertions. From each assertion it reads:

| Ligament uses | SAML attribute it looks for | If the attribute is missing |
| --- | --- | --- |
| Email address | `email` | The NameID |
| Name | `givenName` and `surname`, else `displayName` | The NameID |

Attribute names must match exactly. Entra’s default claims use long URI names, so with a default Entra app Ligament takes the email address from the NameID, which Entra sets to the user principal name. If your UPNs aren’t the same as people’s email addresses, change the **Unique User Identifier (Name ID)** claim to `user.mail`, or add a claim named `email` with no namespace.

## How people sign in

On the sign-in page, a person enters their work email and selects **Sign in with SSO**. Ligament uses the email’s domain to find the provider of the workspace that verified that domain and sends them to the IdP. When the IdP signs them in, they land back in Ligament.

Start sign-in from Ligament. Signing in from a tile in the IdP’s app portal (IdP-initiated SSO) isn’t supported.

### First sign-in creates the account

The first time someone signs in with SSO, Ligament creates their account and adds them to the workspace that verified their email domain, with that domain’s default role. If the People app is installed, they also get a person record linked to their login. They don’t need an invitation. Someone who already has an account and an email invite to your workspace can accept it by signing in with SSO at the invited address (see [Inviting people](https://docs.ligament.ai/guides/workspaces/inviting-people/index.md)).

To control access before the first sign-in, or to remove people automatically when they leave, add [SCIM provisioning](https://docs.ligament.ai/guides/identity/scim/index.md).

## SSO only accepts your own domains

A provider can only sign people in at the domains it was added for, and only while your workspace holds the verified claim on that domain. Ligament checks this on the first sign-in and again on every sign-in after it, using the email address in the fresh assertion.

If the IdP sends an address at any other domain, Ligament doesn’t sign the person in, doesn’t create an account and doesn’t add anyone to a workspace. The person sees this page:

\[Screenshot: The Sign-in refused page: the identity provider signed you in with an email address outside the domains it is set up for, with error code sso\_domain\_mismatch and a Back to sign in button\]

Every refusal is recorded. Find it in **Logs › Audit › Security & sign-ins** under the event type **SSO sign-in refused**, next to **SSO provider added** and **SSO provider removed**.

## Make SSO the only way in

SSO works alongside the other sign-in methods. To stop people at your verified domain from using a password or a magic link, turn off **Allow password sign-in** and **Allow magic-link sign-in** in **Settings › Sign-in security › Policy**. Someone who then tries a password sees “Password sign-in is disabled for your organization. Use SSO or a passkey.” SSO and passkeys stay available.

## Groups and roles

Roles for SSO users come from the domain’s default role and from what you assign in Ligament. To manage roles from your IdP’s groups, push the groups with [SCIM](https://docs.ligament.ai/guides/identity/scim/index.md) and map each group to roles in [Groups](https://docs.ligament.ai/guides/access/groups/index.md). Providers added in Settings › Single sign-on send only the email address and name, so Ligament doesn’t read group claims from them.

## Remove a provider

Select **Remove** on the provider under **Configured providers**. People at that domain can no longer start an SSO sign-in; existing accounts stay, and they can sign in with any method your policy still allows.

## Troubleshooting

| What you see | What to check |
| --- | --- |
| “No SSO provider found for this domain” after **Sign in with SSO** | The domain isn’t verified by any workspace, or no provider is configured for it. Check Settings › Domains and Settings › Single sign-on. The match is on the exact domain: `eu.northwind-example.com` is a different domain from `northwind-example.com`. |
| Entra error `AADSTS50011` (reply URL mismatch) | The Reply URL in Entra must be the provider’s ACS URL ending in `/sp/acs/<providerId>`, and only that one. Retry in a new private window: an open tab can replay the old request. |
| “Sign-in refused” with error code `sso_domain_mismatch` | The IdP sent an email address at a domain the provider wasn’t added for, often a UPN like `priya.raman@northwind.onmicrosoft.com`. Fix the Name ID or `email` claim in the IdP, or verify that domain and add a provider for it. |
| “Account not linked” | An account with this email address already exists and isn’t linked to the IdP. The person signs in the way they usually do. |
| The person signs in but has the wrong role | New people get the default role of the verified domain. To change it for future sign-ins, claim the same domain again in Settings › Domains with a different role. Change the person’s own role in Admin › Members. |
