Set up single sign-on
Single sign-on (SSO) lets your people sign in to Lainstack with the account they already use at work, through your company’s identity provider. Lainstack supports any provider that speaks OpenID Connect (OIDC) or SAML 2.0.
This guide is for the person who looks after sign-in for your company. You need permission to manage single sign-on for your super organization, access to your identity provider’s settings, and a way to publish a DNS record for your email domain.
How it works
Section titled “How it works”SSO belongs to your super organization, so one connection covers every organization and workspace under it. You set it up on three pages under Settings, then Super organization:
- Single sign-on connects your identity provider.
- Domains proves your company owns its email domain, such as
example.com. - Security chooses a recovery administrator and requires SSO.
SSO doesn’t let anyone join just because their address is in your domain. People still get in by invitation or by SCIM provisioning.
1. Start the connection
Section titled “1. Start the connection”Open Settings, Super organization, Single sign-on. Choose OpenID Connect (OIDC) or SAML and click Start setup.
The protocol can’t be changed once setup has started. To switch, open the Single sign-on maintenance menu and choose Discard setup, then start again.
2. Connect your identity provider
Section titled “2. Connect your identity provider”Follow the steps for the protocol you chose.
OpenID Connect
Section titled “OpenID Connect”- In your identity provider, create a web application (a confidential client that uses the authorization code flow).
- Copy the Redirect URI from Lainstack into the application’s allowed redirect URIs. It ends in
/endpoint. Use exactly this address. - Make sure the application releases the
openid,emailandprofilescopes. - Back in Lainstack, enter the provider’s Issuer URL, the application’s Client ID and its Client secret, then click Save provider settings.
Use the issuer for your own tenant. A shared, multi-tenant issuer, such as Microsoft’s common endpoint, is refused.
The client secret is never shown again. When you edit the provider later, leave the secret empty to keep the one you saved.
- In your identity provider, create a SAML application. Give it the ACS URL and Entity ID from Lainstack, or upload the file from Download Lainstack metadata XML.
- Have the provider sign its assertions. Lainstack refuses unsigned ones.
- Back in Lainstack, give it your provider’s metadata, either as a Metadata URL or, with Use metadata XML instead, as the XML itself. Click Save provider settings.
Lainstack reads the signing certificate from the metadata. When your provider rotates its certificate, save new metadata that lists both the current certificate and the new one, before the current one expires.
When the settings are valid, the connection shows Available and an Organization sign-in link, which ends in /login/sso/ and your super organization’s short name. Share that link with your people.
3. Verify your email domain
Section titled “3. Verify your email domain”Lainstack trusts the email address your provider sends only when its domain is one you have verified.
- Open Settings, Super organization, Domains and click Add domain. Enter the domain on its own, such as
example.com. Subdomains count as separate domains. - Lainstack shows a DNS record to publish: a TXT record named
_lainstack.example.comwith a one-time value. Copy it now. If you lose it, click Generate new DNS record; the previous value then stops working. - Publish the record at your DNS provider, then click Verify domain. The domain shows Verified once Lainstack can read the record.
Keep the record in place. Lainstack checks it again at most once a day. If it is missing three checks in a row, the domain stops vouching for new people. Anyone already signed in through SSO keeps working, and the domain recovers as soon as the record is back.
4. Check what your provider sends
Section titled “4. Check what your provider sends”Lainstack needs the person’s email address from your provider, in a domain you verified.
- OIDC reads the
emailclaim. A person whose account has no email address is refused. In Microsoft Entra ID this is the user’s Email (mail) property, which is often empty for accounts that have no mailbox. - SAML reads an attribute named
email,http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddressorurn:oid:0.9.2342.19200300.100.1.3. First and last names are read fromfirstNameandlastName, thegivennameandsurnameclaims, or theirurn:oidforms, so people don’t have to type their name on their first sign-in. - Verified email. If your OIDC provider sends
email_verified, it must betrue. Leaving it out is fine. A provider that sendsfalsetells Lainstack nobody has confirmed the address, and that person is asked to confirm it by email every time they sign in. If you run your own Keycloak, mark your people’s emails as verified, for example by turning on Trust Email for your directory connection.
Who can sign in
Section titled “Who can sign in”Signing in through SSO connects a person’s provider account to their Lainstack account the first time they use it. That happens only when:
- their email address is in one of your verified domains, and
- they already belong to your super organization, or to one of its organizations or workspaces, or they have a pending invitation into it.
An invited person who has no Lainstack account yet gets one on their first sign-in and accepts the invitation from Personal, Invitations. When their address is in a verified domain, their invitation email links straight to your organization sign-in.
After that first sign-in, Lainstack knows the person by their provider account, not by their address. If you change someone’s email address in your provider, Lainstack follows it on their next sign-in, as long as both the old and new addresses are in your verified domains and nobody else in Lainstack already has the new one.
A session that started through your provider lasts 30 minutes. As it nears the end, the next page a person opens checks with your provider again. If they are still signed in there, they carry on without typing a password. If you have disabled them in your provider, they are signed out.
5. Choose a recovery administrator
Section titled “5. Choose a recovery administrator”Before you require SSO, choose someone who can still get in if your identity provider is down or misconfigured.
- Open Settings, Super organization, Security.
- In Recovery administrator, click Choose.
- Pick a person and give a reason. The list shows why the others can’t be chosen. The recovery administrator must:
- be a Director or Finance in the super organization,
- have an email address outside your verified domains, and
- have finished setting up password sign-in.
The page shows a Recovery sign-in link. The recovery administrator should bookmark it. Signing in there uses their password, outside SSO, and lets them stop requiring SSO.
Require SSO stays unavailable until a recovery administrator is chosen.
6. Require SSO
Section titled “6. Require SSO”To require SSO you must be signed in through it yourself. Use your organization sign-in link, then open Security and click Require SSO.
From then on, anyone whose address is in a verified domain is sent straight to your identity provider. Password sign-in and Google or Microsoft sign-in are refused for those addresses. People with addresses outside your domains, such as contractors, sign in as before.
Lainstack checks the connection again before it switches. If the check fails, the connection shows Needs attention and SSO is not required.
To go back, click Stop requiring SSO. People can use their usual sign-in methods again, and the connection stays available.
Connection states
Section titled “Connection states”| State | What it means |
|---|---|
| Setup in progress | Provider settings are still being entered. Nobody can sign in through it yet. |
| Available | The connection works, and so does the organization sign-in link. |
| Needs attention | Something no longer matches, such as a changed provider or a domain that failed its checks. New sign-ins through SSO are refused until you fix it. Open the Single sign-on maintenance menu, choose Edit provider and save again. If SSO is required, stop requiring it first. |
| Disabled | The connection can’t be used to sign in. Your verified domains stay. |
If something goes wrong
Section titled “If something goes wrong”- Your provider says the redirect URI or ACS URL doesn’t match. Copy it again from Single sign-on. Each connection has its own address.
- A person is refused after signing in at your provider. Check that their email address is in a verified domain, that they belong to your organization or have a pending invitation, and that your provider sends their email address.
- A person is asked to confirm their email on every sign-in. Your provider sends
email_verifiedasfalsefor them. Mark their email as verified in your provider. - Nobody can sign in through SSO. Ask your recovery administrator to sign in with their recovery link and stop requiring SSO, then check the provider settings.