The short answer
Add single sign-on by supporting OpenID Connect first, which covers Google Workspace and Microsoft Entra, then SAML 2.0 for customers whose identity provider requires it. Store the setup per tenant, match users by a verified email domain, keep a break-glass admin login, and add SCIM later for automatic user provisioning. Plan on weeks of work with testing, not an afternoon.
On this page
A company with 200 employees will not give each of them another password. Its IT team wants to control who can sign in from one place, switch access off when someone leaves, and enforce multi-factor authentication. That is single sign-on (SSO), and in many deals it is the first item on the security questionnaire.
This article explains what to build, in what order, and where teams get caught.
What is single sign-on, in plain terms?
The customer keeps its users in an identity provider (IdP) such as Google Workspace, Microsoft Entra ID (formerly Azure AD), Okta or JumpCloud. Your app trusts the IdP to say who the user is. The user clicks “Sign in with your company”, is sent to the IdP, signs in there with the company’s rules, and comes back to your app signed in.
SAML or OpenID Connect?
| OpenID Connect (OIDC) | SAML 2.0 | |
|---|---|---|
| Age and feel | Newer, built on OAuth 2.0 and JSON | Older, built on XML |
| Supported by | Google Workspace, Microsoft Entra, Okta, most modern IdPs | Almost every enterprise IdP, including older ones |
| Setup | Client ID, secret and a discovery URL | Metadata exchange, certificates, attribute mapping |
| Who asks for it | Smaller and mid-sized customers | Large and regulated customers, often by name |
Build OIDC first: it is simpler, and it covers Google Workspace and Entra. Add SAML when a customer needs it. Do not write either protocol yourself. Use a maintained library or your authentication framework’s SSO plugin, and have it reviewed. Signature validation mistakes in SAML are a classic security hole.
What does the tenant model need?
SSO is configured per customer account (tenant), not for the whole app. For each tenant, store:
- The IdP type and its settings (issuer, endpoints, client ID, certificate), with secrets encrypted.
- The email domains that belong to the tenant, verified by a DNS record, so only the real owner of a domain can claim it.
- A policy: SSO optional, or SSO required for everyone in that domain.
- A default role for new users, and a mapping from IdP groups to your roles if the customer wants it.
Keep this in your database. If it lives in a config file, every new customer needs a deploy. Treat each customer’s settings as data that must never leak between tenants, and test it: see proving tenant isolation in CI.
How do you handle the user lifecycle?
Signing in is the easy part. The rest decides whether IT is happy.
- Just-in-time (JIT) provisioning. On first SSO sign-in, create the user in the right tenant with the default role.
- Matching existing users. If someone already has a password account with the same email, link it only after the domain is verified. Otherwise you create duplicates, or worse, let one person take over another’s account.
- Deprovisioning. When someone leaves the company, access should end. With JIT only, a user is blocked at the IdP, but their existing session in your app may live on. Keep session lifetimes short for SSO tenants, and re-check with the IdP.
- SCIM. The standard for automatic user creation, updates and removal. It is the next step after SSO, and many enterprise buyers ask for it. Build it after SSO works.
- Roles. Decide who is an admin, and whether the IdP or your app is the source of truth.
What mistakes delay deals?
- No test environment for the customer. Give the customer’s IT a way to test SSO before enforcing it, with a clear error message about what failed.
- Locked-out admins. If SSO breaks, no one can sign in to fix it. Keep a documented “break-glass” owner login that bypasses SSO, with strong protection and an audit log entry.
- Email as the identity. Emails change. Store the IdP’s stable subject identifier and match on it after the first sign-in.
- Open redirects and loose callbacks. Only accept your registered callback URLs and check the state and nonce.
- Forgetting the API and mobile apps. Sessions started by SSO need the same rules on every client.
- No documentation. A one-page setup guide for Google Workspace and one for Entra saves a week of back-and-forth per customer.
What does it cost to build?
We do not give figures here because it depends on your stack. The effort drivers are: how your sessions work today, whether your user table can hold the same email in more than one tenant, how many IdPs you support at first, and how much testing against real identity providers you do. Plan for development, then time with at least one real customer’s IdP, which is where problems show up.
How do you know it is done?
- A user from a verified domain signs in through Google Workspace and through Entra, and lands in the right tenant.
- A user from another domain cannot get into that tenant.
- A removed IdP user loses access within a defined time.
- Sign-ins and configuration changes appear in the audit log: see adding audit logs.
- Tests prove a tenant’s SSO setting cannot be read or changed from another tenant.
Working with us
We build multi-tenant SaaS platforms, including sign-in, roles and tenant isolation, and we can add SSO to a product that already exists. Describe your stack and the identity providers your buyers use through the contact page, or see our SaaS platform work.