SSO

Single Sign-On: Use Case Examples & Sample SSO Process

Single Sign-On Example at a Glance

Single sign-on (SSO) lets a person sign in once with one identity provider and then use several applications without signing in again. The applications never see the password: they trust a signed message from the identity provider that says who the user is. In the most common business example, Jane opens a SaaS app at work, types her company email, is sent to her company’s identity provider, and lands back in the app signed in, without ever creating a password for it. This guide walks through that example message by message, after a quick look at the other places you meet SSO every day.

Everyday Single Sign-On Examples

Most people use SSO several times a day without noticing. The examples fall into four patterns, and only some of them are SSO in the strict sense:

PatternExampleWho runs the identity providerTypical protocol
One company’s own appsSigning in to Gmail also signs you in to YouTube and Google DriveThe same company that runs the appsInternal (shared session)
Workforce SSOAn employee signs in to Okta or Microsoft Entra ID each morning, then opens Slack, Salesforce and Zoom without new passwordsThe employer’s IT teamSAML 2.0 or OIDC
B2B SaaS enterprise SSOEmployees of a customer company sign in to your SaaS product with their corporate accountYour customer, one identity provider per customerSAML 2.0 or OIDC
Social login“Sign in with Google” on a third-party siteA consumer identity providerOIDC

Social login is closely related but works differently from enterprise SSO: the user picks from the providers the app offers, and the user’s employer has no control over it. The rest of this guide focuses on the B2B SaaS pattern, because it is the one product teams have to build when enterprise customers start asking for SSO.

Step-by-Step Example of a Single Sign-On Process (SAML)

Here is a concrete scenario. Jane works at Acme. Acme uses an identity provider (IdP) such as Okta or Microsoft Entra ID, and has connected it to YourSaaS, a project-management product. YourSaaS is the service provider (SP). Jane opens app.yoursaas.com and enters jane@acme.com. This is SP-initiated SSO using the SAML 2.0 Web Browser SSO profile (OASIS SAML profiles, section 4.1):

  1. Jane requests the app. She isn’t signed in, so YourSaaS needs to authenticate her.
  2. YourSaaS finds Acme’s identity provider. It looks up the domain acme.com, which Acme verified when it set up SSO, and finds Acme’s SAML connection.
  3. YourSaaS sends an authentication request. It redirects Jane’s browser to Acme’s IdP with a SAML AuthnRequest in the URL, plus a short RelayState value that remembers the page she wanted.
  4. Acme’s IdP authenticates Jane. If she already has an IdP session from this morning, this step is invisible. Otherwise she signs in there, with Acme’s password and MFA rules.
  5. The IdP sends back a signed response. Jane’s browser POSTs a SAML Response containing a signed assertion to YourSaaS’s assertion consumer service (ACS) URL.
  6. YourSaaS validates the assertion and signs Jane in. It checks the signature and conditions (listed below), creates or updates Jane’s user record, maps her groups to roles, starts a session and returns her to the page in RelayState.

What the SAML messages look like

The authentication request YourSaaS sends in step 3 is short. In the redirect it is compressed and encoded into a SAMLRequest query parameter:

<samlp:AuthnRequest
    xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
    xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
    ID="_4fd3a1c7e9b2"
    Version="2.0"
    IssueInstant="2026-11-22T10:15:00Z"
    Destination="https://idp.acme.com/sso/saml"
    AssertionConsumerServiceURL="https://app.yoursaas.com/saml/acs"
    ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST">
  <saml:Issuer>https://app.yoursaas.com/saml/metadata</saml:Issuer>
  <samlp:NameIDPolicy
      Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"
      AllowCreate="true"/>
</samlp:AuthnRequest>

The response in step 5 carries the assertion. This simplified version, with namespaces, the signature value and some required attributes removed, highlights the parts YourSaaS has to check:

<Response ID="_9a8b7c6d" Version="2.0" IssueInstant="2026-11-22T10:15:04Z"
          InResponseTo="_4fd3a1c7e9b2"
          Destination="https://app.yoursaas.com/saml/acs">
  <Issuer>https://idp.acme.com</Issuer>
  <Status><StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/></Status>
  <Assertion ID="_1e2f3a4b" Version="2.0" IssueInstant="2026-11-22T10:15:04Z">
    <Issuer>https://idp.acme.com</Issuer>
    <Signature>...</Signature>
    <Subject>
      <NameID>jane@acme.com</NameID>
      <SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
        <SubjectConfirmationData InResponseTo="_4fd3a1c7e9b2"
            Recipient="https://app.yoursaas.com/saml/acs"
            NotOnOrAfter="2026-11-22T10:20:04Z"/>
      </SubjectConfirmation>
    </Subject>
    <Conditions NotBefore="2026-11-22T10:14:34Z" NotOnOrAfter="2026-11-22T10:20:04Z">
      <AudienceRestriction>
        <Audience>https://app.yoursaas.com/saml/metadata</Audience>
      </AudienceRestriction>
    </Conditions>
    <AuthnStatement AuthnInstant="2026-11-22T10:15:02Z" SessionIndex="_s51a2b">
      <AuthnContext>
        <AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</AuthnContextClassRef>
      </AuthnContext>
    </AuthnStatement>
    <AttributeStatement>
      <Attribute Name="groups"><AttributeValue>finance-admins</AttributeValue></Attribute>
    </AttributeStatement>
  </Assertion>
</Response>

What the service provider must validate

Skipping any of these checks is a common source of SAML vulnerabilities. The SAML profiles and bindings specifications require the service provider to verify:

CheckWhy it matters
The assertion signature, against the certificate Acme uploadedProves the IdP issued it and nobody altered it
Audience equals YourSaaS’s entity IDStops an assertion meant for another app being replayed against yours
Recipient and Destination equal your ACS URLConfirms the response was sent to this endpoint
NotOnOrAfter and NotBefore, with a small clock-skew allowanceRejects expired or not-yet-valid assertions
InResponseTo matches the ID of the request you sentTies the response to Jane’s login attempt
The assertion ID hasn’t been used beforePrevents replay of a captured assertion
User details are read only from the element the signature coversPrevents XML signature-wrapping attacks, where an attacker adds an unsigned assertion next to the signed one

IdP-initiated variant

Jane can also start from Acme’s side by clicking the YourSaaS tile on her Okta or Microsoft dashboard. The flow then begins at step 5: the IdP sends an unsolicited response without an earlier request. Because there is no request, the response has no InResponseTo to check, which makes replay protection and short assertion lifetimes more important. The IdP may send a RelayState with the page to open; otherwise YourSaaS sends Jane to a default landing page.

The Same Example with OpenID Connect

If Acme connects through OpenID Connect (OIDC) instead of SAML, the user experience is identical but the messages differ. OIDC uses the authorization code flow defined in OpenID Connect Core 1.0, ideally with PKCE added. In step 3, YourSaaS redirects Jane to Acme’s authorization endpoint:

https://idp.acme.com/authorize
  ?response_type=code
  &client_id=yoursaas-client-id
  &redirect_uri=https%3A%2F%2Fapp.yoursaas.com%2Foidc%2Fcallback
  &scope=openid%20email%20profile
  &state=af0ifjsldkj
  &nonce=n-0S6_WzA2Mj

After Jane authenticates, the IdP redirects back with a one-time code. YourSaaS’s backend exchanges the code at the IdP’s token endpoint for an ID token, a signed JWT about Jane:

{
  "iss": "https://idp.acme.com",
  "sub": "00u8f2k3j4",
  "aud": "yoursaas-client-id",
  "exp": 1795342800,
  "iat": 1795342500,
  "nonce": "n-0S6_WzA2Mj",
  "email": "jane@acme.com"
}

YourSaaS validates the token signature, checks that iss is Acme’s IdP and aud contains its own client ID, confirms the token hasn’t expired, and checks that nonce matches the value it sent. The state value, bound to Jane’s browser, protects the callback against cross-site request forgery.

SAML 2.0OpenID Connect
Message formatXML assertionJSON Web Token (ID token)
How the identity reaches the appBrowser POSTs the assertion to the ACS URLBrowser carries a code; the backend fetches the ID token
Setup values Acme providesSSO URL and signing certificate, or a metadata URLIssuer, client ID and client secret

Major enterprise IdPs such as Okta and Microsoft Entra ID support both, but individual customers often have a preference, so supporting both covers nearly every enterprise request. For more on SAML, see our SAML guide.

What Changes When You Offer SSO to Many Customers

Jane’s login is one connection. A B2B SaaS product has one connection per customer, which adds problems a single-company SSO setup never meets:

  • Routing users to the right IdP. The usual approach is to ask for the email address first and route by domain. Each customer must prove it owns its domain, typically with a DNS TXT record, so one customer can’t capture another’s users.
  • Letting customers set up SSO themselves. Each customer’s IT admin needs your ACS URL and entity ID, and has to give you their SSO URL and certificate, metadata URL, or OIDC client details. A self-service screen avoids a support ticket per customer.
  • Creating users. With just-in-time (JIT) provisioning, the account is created at first SSO login from the assertion. With SCIM, the customer’s IdP creates, updates and deactivates accounts ahead of time, so leavers lose access even if they never log in again.
  • Mapping groups to roles. Map an IdP group such as finance-admins to a role in your product, and decide whether roles update at every login or only at the first one.
  • Enforcing SSO. Once SSO works, many customers want password login turned off for their domain, with a break-glass admin account kept for emergencies.
  • Rotating certificates. IdP signing certificates expire. Accept a second certificate during the changeover, or SSO for that customer breaks the day the old one expires.

Single Sign-On Planning and Implementation Best Practices

  • Support SAML and OIDC. Enterprise customers choose the protocol their IdP supports best, not you.
  • Use a maintained library or service for SAML validation. XML signature handling is easy to get wrong; don’t write it from scratch.
  • Keep sessions bounded. Set an idle timeout and a maximum session length in your app, and decide whether your session should end when the IdP session ends (single logout).
  • Test with the IdPs your customers use. Okta, Microsoft Entra ID and Google Workspace each format attributes differently; test group claims and email formats with each.
  • Log every SSO login and failure per customer. When a customer’s SSO breaks, usually after a certificate or attribute change, those logs are how support finds the cause quickly.

Implementing SSO with Frontegg

Frontegg handles the B2B SaaS side of the example above. According to Frontegg’s SSO documentation, you enable SAML 2.0 or OIDC for your product, and each of your customers’ admins then configures their own connection (identity provider, domains and attribute mapping) in Frontegg’s self-service admin portal:

  • Identity providers. The SAML setup guide lists Okta, Google, Microsoft Entra ID, OneLogin, PingIdentity, JumpCloud and Rippling, plus any other IdP that follows SAML 2.0. Admins provide their IdP’s SSO endpoint and public certificate.
  • Domain routing. Users are redirected to SSO based on their email domain, after the customer claims the domain with a DNS TXT record. An account can configure multiple domains.
  • Provisioning. Frontegg provisions users just in time from the details passed during login, and customers can add SCIM provisioning from their IdP.
  • Roles. For SAML, IdP groups can be mapped to roles in your product. By default, roles are assigned at the first SSO login.

That covers the self-service setup, routing and provisioning work described in this guide, so your team doesn’t build it per customer. See user management for how SSO users fit into the rest of your account model.

Start For Free

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