# Enterprise sign-in (SAML)

Source: https://openpanel.sh/docs/members/enterprise-sign-in

Let people with your company's email address sign in through your identity provider with SAML 2.0, after proving the domain with a DNS TXT record; joining the organization still takes an invitation.

With enterprise sign-in, people whose email address is at your company's domain sign in to OpenPanel through your identity provider, such as Okta, Microsoft Entra ID or Google Workspace, using SAML 2.0. It switches on only after you prove the domain is yours with a DNS record.

Enterprise sign-in signs people in. It does not add them to your organization: they still join by [invitation](/docs/members/invite), with the role you choose.

<Callout type="info" title="SAML only">
OpenID Connect providers are not offered. Set your identity provider up as a SAML 2.0 application.
</Callout>

## Before you start [#before-you-start]

- **The Owner or Admin role** in the organization.
- **Admin access to your identity provider**, to create a SAML application.
- **Access to your domain's DNS**, to add one TXT record.
- **Your provider ID.** OpenPanel names your provider `org-` followed by your domain with every character other than a letter or a digit turned into a dash, at most 40 characters in all. For `acme.com` it is `org-acme-com`. The steps below use that example.

## Set it up [#set-it-up]

<Steps>
<Step>
### Create a SAML application at your identity provider [#create-a-saml-application-at-your-identity-provider]

Use these values, with your own provider ID in place of `org-acme-com`:

| Setting at your identity provider | Value |
|---|---|
| Reply URL (Assertion Consumer Service, ACS) | `https://openpanel.sh/api/auth/sso/saml2/callback/org-acme-com` |
| Entity ID (audience) and metadata | `https://openpanel.sh/api/auth/sso/saml2/sp/metadata?providerId=org-acme-com` |
| Email | Send the person's email address as the NameID, or as an attribute named `email`. |
| Name (optional) | Attributes `givenName` and `surname`, or `displayName`. |

From the application, copy its **sign-in URL** (often called the SSO URL) and its **signing certificate** in PEM format, the text that starts with `-----BEGIN CERTIFICATE-----`.
</Step>

<Step>
### Add the provider in OpenPanel [#add-the-provider-in-openpanel]

Open the account menu, choose **Organization settings**, and under **Enterprise sign-in** choose **Set up a provider**. Fill in:

- **Company email domain**, for example `acme.com`;
- **Sign-in URL (SSO URL)**;
- **Signing certificate (X.509, PEM)**.

Choose **Save provider**. The provider appears with the state **Domain not proven**. Until the domain is proven, nobody signs in through it.
</Step>

<Step>
### Prove the domain [#prove-the-domain]

Under the provider, OpenPanel shows the TXT record to add. Choose **show the value** to see it, then add the record at your DNS host:

| Type | Name | Value |
|---|---|---|
| TXT | `_better-auth-token-org-acme-com.acme.com` | The value OpenPanel shows |

The value stays valid for 7 days. If it expires before you check it, choose **show the value** again for a new one.
</Step>

<Step>
### Check the record [#check-the-record]

Once the record is published, choose **Check the record**. When OpenPanel finds it, the provider's state changes to **On** and the console says "Domain proven. Enterprise sign-in is on."
</Step>
</Steps>

## What happens next [#what-happens-next]

- **On the sign-in page**, a person who types an address at your domain goes straight to your identity provider instead of being asked for a password.
- **People can also start from** **Single sign-on (SAML)** under the sign-in form, and enter their work email there.
- **OpenPanel sends no sign-in links by email** to addresses at your domain.
- **Someone who signs in for the first time** this way gets an OpenPanel account, with their own organization, like anyone who signs up. To work in yours, they need an invitation.

<Callout type="warn" title="Two-factor sign-in does not apply here">
OpenPanel's own two-factor code is asked only after a password. A sign-in through your identity provider does not ask for it, so require multi-factor authentication in your identity provider.
</Callout>

## Remove the provider [#remove-the-provider]

Under **Enterprise sign-in**, choose **Remove** next to the provider. The sign-in page then asks people at your domain for a password again, and they can use any other way into their account. Their membership in the organization does not change.

## What can go wrong [#what-can-go-wrong]

| What you see | What to do |
|---|---|
| "Enter your company's email domain, like acme.com." | Enter only the domain, without `@` or `https://`. |
| "The DNS record was not found yet. It can take a few minutes to appear." | Check the record's name and value at your DNS host, wait, and choose **Check the record** again. |
| "No company sign-in is set up for that email's domain." (on the single sign-on page) | The domain is not proven yet, or the address is at another domain. |
| "Your company's provider did not sign you in. Try again, or ask your administrator." | Your identity provider refused or the response did not match. Check the reply URL, the entity ID and the certificate at your provider. |