The short answer
- Single sign-on (SSO) lets a customer’s staff sign in to your SaaS with the work account they already have, managed in an identity provider such as Microsoft Entra ID, Okta or Google Workspace.
- SAML 2.0 is the older XML-based standard that many enterprise IT teams still ask for, and OpenID Connect is the newer standard built on OAuth 2.0 and JSON tokens; many SaaS products support both.
- Enterprise buyers usually ask for SSO, SCIM provisioning so accounts are created and removed automatically, and the option to enforce SSO so staff cannot sign in with a password.
Single sign-on (SSO) lets people sign in to your SaaS using the account their employer already manages, instead of a separate username and password. For a B2B product it means supporting SAML 2.0 and OpenID Connect, the two standards identity providers use, and linking each customer’s identity provider to that customer’s tenant. Larger buyers will also ask for SCIM provisioning and the option to make SSO the only way in.
How single sign-on works
Two parties are involved. The identity provider (IdP) holds the customer’s staff accounts. Examples include Microsoft Entra ID, Okta, Google Workspace and JumpCloud. The service provider is your product. The IdP proves who the person is, and your product trusts that proof because the two were connected in advance.
- The user enters their work email address on your sign-in page.
- Your product finds the SSO connection for that email domain and sends the browser to the customer’s IdP.
- The user signs in there, including any multi-factor authentication their company requires.
- The IdP sends the browser back with a signed statement of who the user is.
- Your product checks the signature, the intended audience and the expiry time, then finds or creates the user in that tenant and starts a session.
Your product never sees the user’s password. When the company disables the person’s account in its IdP, they can no longer start new sessions in your product.
SAML 2.0 and OpenID Connect compared
Both standards do the same job. SAML 2.0 became a standard in 2005 and is still common across enterprise IT. OpenID Connect, finalised in 2014, is an identity layer on top of OAuth 2.0 and is the usual choice for newer services and for mobile apps.
| SAML 2.0 | OpenID Connect | |
|---|---|---|
| Message format | Signed XML assertions | Signed JSON Web Tokens, called ID tokens |
| Built on | Its own XML protocol | OAuth 2.0 |
| Setup | Exchange metadata containing URLs and certificates | Client ID, client secret and the IdP’s issuer URL |
| Typical use | Enterprise web applications | Newer IdPs, web and mobile apps |
| Key rotation | Often manual, by swapping certificates | Usually automatic, by fetching the IdP’s published keys |
| Where bugs tend to appear | XML signature validation | Token checks and redirect URL rules |
The main enterprise IdPs support both, so build the one your first enterprise customers ask for and add the other later. Whichever you choose, use a well-maintained library. XML signature validation in particular has a long history of serious security bugs, and it is not code to write from scratch.
What enterprise buyers ask for
A security team reviewing your product rarely stops at “do you support SSO”. Expect these requests to arrive together.
SSO with their own identity provider
The customer’s admin should be able to set up the connection from a settings screen, by uploading SAML metadata or entering OpenID Connect details, and test it before switching it on for everyone.
SCIM provisioning
SCIM (System for Cross-domain Identity Management) is a standard REST API that lets the IdP create, update and deactivate users and groups in your product. Its main value is offboarding. When someone leaves and IT disables them centrally, SCIM removes their access to your product as well, without anyone having to remember.
Enforced SSO
The customer can require everyone with their email domain to sign in through SSO, with password sign-in switched off. Keep a break-glass route, such as one owner who can still sign in another way, so a broken IdP configuration doesn’t lock the whole company out.
Just-in-time provisioning
Just-in-time provisioning creates an account the first time someone signs in through SSO, using the name and email address the IdP sends. It is simpler than SCIM and enough for many smaller customers. It can’t remove anyone, though, because a person who has left never signs in again to trigger it.
Group-to-role mapping
Groups in the IdP, such as Finance or Site managers, map to roles in your product, so access follows the customer’s own structure. This depends on having a clear model of roles and permissions first.
Build it or use an identity service
There are three routes. You can add SAML and OpenID Connect to your own authentication using open-source libraries. You can run an open-source identity server such as Keycloak. Or you can use a hosted identity service such as Auth0, WorkOS, AWS Cognito or Microsoft Entra External ID, which handles the protocol work and often gives your customers’ admins a ready-made setup screen.
Hosted services save a lot of protocol work and keep up with the quirks of different IdPs. They also add a supplier to your sub-processor list and a running cost, often charged per SSO connection or per active user, so check that cost against your plan prices. Building it yourself makes sense when authentication is central to your product or you have specific data residency needs. For most early SaaS products we’d use a hosted service or a mature library, and spend the time saved on provisioning and permissions.
Whichever route you take, test against the identity providers your customers actually use. Microsoft Entra ID, Okta and Google Workspace each name and format user attributes and groups in their own way, and those differences tend to surface during the first enterprise rollout.
How SSO fits multi-tenancy
In a multi-tenant product, every SSO connection belongs to exactly one tenant (multi-tenancy explained). That rule drives several design decisions.
- Verify domains. Before a tenant can route an email domain to its IdP, it proves it owns the domain, usually by adding a DNS TXT record. Otherwise one customer could claim another company’s staff.
- Never link users across tenants on email alone. A sign-in from tenant A’s IdP only signs the user into tenant A.
- Allow people to belong to more than one tenant. A consultant might use SSO for their employer’s account and a password or email link for a client’s.
- Store connection settings per tenant, including certificates and their expiry dates, and warn admins well before a certificate expires.
- End sessions when access ends. Keep sessions reasonably short, and when SCIM deactivates a user, revoke their sessions and API tokens too.
Common mistakes with SSO
Most SSO problems come from shortcuts in validation and in linking accounts. These are the ones to check for in review.
- Accepting an assertion without checking its signature, issuer, audience and time window.
- Allowing no tolerance for small clock differences between servers, so sign-ins fail at random.
- Linking an SSO identity to an existing password account without proof that the same person controls both.
- Leaving password sign-in open after the customer has asked to enforce SSO.
- Not recording changes to SSO settings, which are among the most sensitive actions in the product, in the audit log.
Questions people ask
Is SAML or OpenID Connect more secure?
Both are secure when implemented with a maintained library, signed messages and strict validation. Real-world SSO flaws usually come from implementation mistakes, such as skipped signature checks or loose redirect URL rules. Choose the standard your customers’ identity providers and IT teams prefer.
Does SSO replace multi-factor authentication?
SSO moves authentication to the customer’s identity provider, which is where multi-factor authentication is then applied for those users. Your product should still offer its own multi-factor authentication for people who sign in with a password, such as small customers without an identity provider.
What is the difference between SSO and SCIM?
SSO handles signing in. SCIM handles the user list, creating, updating and deactivating accounts in your product when they change in the customer’s identity provider. Without SCIM, a person removed from the IdP can’t sign in again, but their account, open sessions and API tokens may remain in your product.
Should SSO be a paid feature?
Many B2B SaaS products include SSO only in higher tiers, because the customers who need it are larger and it carries support work. Others include it on every plan to encourage good security. Either is reasonable if it is a deliberate choice that fits your pricing model.