SSO

What Is Single Sign-On (SSO)? How It Works and How to Implement It

Single sign-on (SSO) lets a user authenticate with a trusted identity provider and then access a connected application without creating or repeatedly entering another password. In B2B SaaS, SSO usually means each customer organization connects its own identity provider to your application using SAML 2.0 or OpenID Connect (OIDC).

SSO centralizes authentication. It does not decide which tenant data or product features a user may access. Your application must still validate the authentication response, establish the correct tenant context, and enforce authorization at the resource level.

Key takeaways

  • SSO delegates authentication to an identity provider; the application remains responsible for its own authorization decisions.
  • SAML and OIDC are the main standards for modern web SSO. OAuth 2.0 supports delegated authorization and is the foundation for OIDC, but OAuth alone does not authenticate a user.
  • Multi-tenant SaaS adds a routing problem: the login flow must resolve the user to the right customer account and SSO connection.
  • SSO and user provisioning solve different jobs. JIT can create a user during login, while SCIM manages lifecycle changes such as provisioning and deprovisioning outside the login flow.
  • A secure rollout tests signatures, issuer and audience values, redirect destinations, tenant boundaries, failure handling, and account recovery.

How does SSO work?

SSO works by establishing trust between an application, called the service provider or relying party, and an identity provider (IdP). The IdP authenticates the user. The application validates the IdP’s response, creates its own session, and applies its own access rules.

A typical service-provider-initiated flow has six steps:

  1. The user opens the application. The app determines that authentication is required.
  2. The app finds the correct identity provider. It may use the user’s email domain, an account-specific login URL, a tenant identifier, or a previous session.
  3. The app redirects the browser to the IdP. The request includes protocol-specific values that bind the response to the initiating flow.
  4. The IdP authenticates the user. Passwordless authentication, MFA, device checks, or other policies can happen here.
  5. The IdP returns an authentication response. This is commonly a SAML response containing an assertion or an OIDC authorization response that leads to ID and access tokens.
  6. The application validates the response and creates a session. It checks the response before mapping the identity to the correct account, roles, and application permissions.

The application should not grant access merely because a response contains an email address or role-like attribute. It must validate the response and confirm that the user belongs to the tenant whose resources are being requested.

SSO architecture for multi-tenant SaaS

Workforce SSO diagrams often show one company IdP connected to many internal tools. Customer-facing B2B SaaS reverses the scale: one application may need to accept SSO connections from hundreds or thousands of customer organizations.

That architecture needs four layers:

LayerResponsibilityMulti-tenant question
Identity providerAuthenticates the user and applies the customer’s identity policyWhich customer owns this connection?
SSO connectionStores protocol metadata, certificates or client settings, domains, and mappingsHow is the correct connection selected?
Identity and membershipMaps the external identity to a user and the user’s relationship with an accountCan one person belong to more than one tenant?
Application authorizationDecides which resources and actions the authenticated user may accessIs every decision constrained to the active tenant?

The tenant-resolution step is easy to underestimate. A domain may map cleanly to one customer, but consultants, subsidiaries, shared domains, and users with several memberships can make email-only routing ambiguous. Define how the login flow behaves when several connections could match and how the user selects or supplies the intended tenant.

A B2B SaaS SSO flow

Company email → candidate tenant → tenant SSO connection → identity provider → validated SAML/OIDC response → tenant membership → active tenant → resource authorization

Authentication is complete only partway through this sequence. The application still has to establish the correct membership and tenant before it decides whether the user may access a resource.

SAML vs. OIDC for SSO

SAML 2.0 and OIDC both support federated login, but they use different messages and fit different application architectures.

StandardWhat it doesCommon fitMain artifact
SAML 2.0Exchanges XML assertions between an IdP and service providerEnterprise browser-based SSO and established corporate IdPsSAML assertion inside a SAML response
OIDCAdds authentication and identity claims on top of OAuth 2.0Modern web, mobile, and API-backed applicationsID token, usually a JWT
OAuth 2.0Delegates authorization to protected resourcesAPI access and third-party authorizationAccess token

SAML is still common when enterprise customers expect a standard integration with Okta, Microsoft Entra ID, Google Workspace, Ping Identity, or another corporate IdP. OIDC often fits modern application stacks and native clients more naturally.

OAuth 2.0 belongs in the comparison because OIDC uses it, not because OAuth is interchangeable with SSO. An OAuth access token says what a client may access. An OIDC ID token communicates authentication information about the end user to the client.

Kerberos can provide SSO inside managed networks, and LDAP or Active Directory can supply directory data, but LDAP is not itself an SSO protocol. Social login also uses federated identity, commonly through OIDC, but it lacks the customer-admin configuration and organizational control expected from enterprise SSO.

For protocol-specific flows, see the SAML SSO implementation guide and the OIDC guide.

SSO, JIT provisioning, and SCIM solve different problems

SSO proves identity during a login flow. It does not, by itself, keep the application’s user directory synchronized with the customer’s source system.

  • Just-in-time (JIT) provisioning creates or recreates a user when that person successfully signs in through SSO. It reduces setup work but only runs when the user attempts to log in.
  • SCIM provisioning lets the customer’s identity system create, update, and remove users or memberships outside the login flow. It is the better fit when access must change before the next login.

For a multi-tenant application, deprovisioning should remove the user’s access to the relevant customer account without automatically deleting a global identity that may still belong to other tenants. The exact model depends on the product, but separating identity from tenant membership prevents one customer’s offboarding action from disabling unrelated access.

Read the SCIM guide for lifecycle design.

Benefits and trade-offs of SSO

SSO reduces the number of passwords users enter and gives customer administrators a central place to enforce authentication policies. It can also reduce password-reset work and make enterprise onboarding easier because customers can use an IdP they already operate.

The same concentration creates risk. If the IdP is unavailable or the connection is misconfigured, many users can be locked out at once. A compromised IdP session can also affect every connected application that trusts it. MFA, short-lived sessions, careful response validation, monitoring, and tested recovery paths remain necessary.

SSO also does not remove application-specific security work. The SaaS product must still protect tenant boundaries, evaluate roles and permissions, revoke its own sessions where appropriate, and log sensitive actions.

How to implement SSO in a B2B SaaS application

1. Define the tenant and identity model

Decide whether a person can belong to several customer accounts, how memberships are represented, and which account is active after login. Write down the expected behavior for invitations, domain changes, mergers, contractors, and offboarding before choosing protocol settings.

2. Choose the supported standards and login surface

Support SAML when enterprise customers require it and OIDC when their IdP and your application architecture favor it. Decide whether login is hosted or embedded, and register exact callback and redirect URLs. Avoid wildcard redirects unless a specific, reviewed use case requires them.

3. Design tenant and connection discovery

Choose how the application finds the right SSO connection. Common inputs include a verified email domain, a tenant-specific URL, an organization slug, or an explicit tenant identifier. Handle ambiguous matches deliberately rather than selecting the first connection returned.

4. Configure and verify the trust relationship

For SAML, exchange entity IDs, endpoints, and signing certificates. For OIDC, configure the issuer, client credentials, redirect URIs, scopes, and discovery metadata. Verify domain ownership before allowing a customer administrator to claim a domain for automatic routing.

5. Validate every authentication response

Check signatures and protocol-specific values before creating a session. Validation includes the expected issuer and audience, expiry and time conditions, destination or redirect URI, and request-binding values such as state and nonce where applicable. Reject responses that cannot be tied to the initiating login flow.

6. Map identity to a tenant-scoped membership

Use stable identifiers where the IdP provides them. Treat email carefully because it can change or be reused. Apply group or attribute mappings only inside the correct customer account, and set conservative defaults for unmapped users.

7. Enforce authorization in the application

After authentication, verify that the user may access the active tenant and requested resource. Roles or group claims can inform the decision, but they do not replace resource-level tenant checks.

8. Test failure and lifecycle paths

Test expired certificates, changed IdP metadata, clock skew, replay attempts, disabled users, deleted memberships, ambiguous domains, IdP downtime, logout, and recovery access. Add SCIM when customers need lifecycle changes to occur independently of login.

For a concrete sequence, use the single sign-on example. For a deeper rollout checklist, see the SSO implementation guide and SSO security best practices.

How Frontegg supports customer-facing SSO

Frontegg supports SAML 2.0 and OIDC connections for customer-facing applications. The SaaS vendor enables the supported standards in its environment. Each tenant can then configure its own identity provider connection, domains, and attribute mapping through the self-service admin portal, or the SaaS team can configure the connection through the management portal or API.

Frontegg’s self-service SAML documentation explains that verified domains route users to the associated SSO flow. Its documentation separately describes just-in-time provisioning during SAML or OIDC login and group-to-role mapping. Applications should still enforce tenant-scoped authorization after authentication.

Review the Frontegg SSO documentation or explore the SSO and SCIM product capability.

SSO implementation checklist

  • The tenant and membership model is documented.
  • Each SSO connection belongs to the correct customer account.
  • Domains are verified before they control login routing.
  • SAML and OIDC responses are validated against expected issuers, audiences, destinations, signatures, expiry, and request context.
  • Ambiguous tenant or connection matches fail safely.
  • Group and role mappings cannot cross tenant boundaries.
  • Application authorization checks both tenant and resource context.
  • JIT and SCIM responsibilities are documented separately.
  • Certificate rotation, IdP outage, logout, and recovery paths are tested.
  • Authentication and sensitive administration events are logged.

References

Looking to take your User Management to the next level?
Sign up. It's free