SAML vs OIDC: Which SSO Protocol Fits Your Apps?

SAML and OIDC both let an identity provider vouch for a user so they sign in once across many apps. SAML, finalised in 2005, passes signed XML assertions through the browser and dominates enterprise SSO. OIDC, finalised in 2014, rides on OAuth 2.0 with JSON tokens and suits mobile and modern apps.

Key takeaways
  • Same job, different eras. Both deliver single sign-on; they were built twenty years of web apart.
  • Format is the visible split. SAML speaks signed XML; OIDC speaks JSON web tokens.
  • Foundations differ. SAML stands alone; OIDC is an identity layer on top of OAuth 2.0.
  • Setup differs too. SAML trades metadata files and certificates; OIDC uses discovery URLs and client registration.
  • Most enterprises run both. The app in front of you usually decides which protocol you configure.

What is SAML and where did it come from?

SAML, the Security Assertion Markup Language, is an OASIS standard for exchanging authentication data between an identity provider and a service provider. Version 2.0 was finalised in 2005.

It was designed for a browser-based, enterprise world. Companies wanted staff to sign in once at a central directory and then open many web applications without fresh passwords.

The SAML answer is the assertion: a signed XML document stating who the user is, when they authenticated, and which attributes, such as department or role, apply.

Two decades on, SAML remains the default for workforce SSO. Most large SaaS vendors support it, and many older applications support nothing else.

SAML grew out of earlier federation work and absorbed a rival standard, which is why version 2.0 felt complete on arrival. Enterprises standardised on it quickly.

Its vocabulary still shapes identity teams. Identity provider, service provider, assertion, and relying party all come from this era of federation design.

What is OIDC and what is it built on?

OpenID Connect is an identity layer the OpenID Foundation finalised in 2014. It extends OAuth 2.0, the delegated authorisation framework, by adding a standard way to prove who signed in.

Its centrepiece is the ID token, a JSON web token carrying claims such as a unique subject identifier, name, and email. JSON keeps the payload small and easy for developers to parse.

OIDC also standardises discovery. A provider publishes a configuration document at a well-known URL, so an application can find endpoints and signing keys without manual file exchanges.

Because it grew from OAuth, one flow can deliver both sign-in and API access. That pairing is why mobile apps, single-page apps, and microservices adopted it quickly.

OIDC deliberately reuses OAuth's machinery rather than inventing parallel plumbing. Developers who already call token endpoints for API access meet familiar patterns at sign-in.

Standard claims keep integrations predictable. A subject identifier, an issuer, and an expiry appear in every ID token, whatever provider issued it.

How does a SAML login flow work?

  1. You open the application, which has no session for you yet.
  2. The application redirects your browser to the identity provider with an authentication request.
  3. The identity provider signs you in, typically against the company directory.
  4. It builds a signed XML assertion about you and sends it back through your browser.
  5. The application validates the signature, reads the attributes, and starts your session.

Notice that your password never touches the application. The signed assertion is the whole basis of trust, which is why signature validation must be strict.

Configuration happens beforehand, out of band. Administrators exchange metadata XML files and certificates between provider and application, a manual step repeated for every integration.

Flows can start at either end. In an identity-provider-initiated login, you begin at the provider's portal and click through; in a service-provider-initiated flow, the app sends you there.

Assertions are short-lived by design. Conditions inside the document bound its validity window, and a well-built application rejects assertions outside it.

How does an OIDC login flow work?

  1. Your app redirects you to the provider's authorisation endpoint, requesting the openid scope.
  2. You authenticate with the provider, as in any OAuth flow.
  3. The provider returns an authorisation code to the app.
  4. The app exchanges the code directly with the provider for an ID token and an access token.
  5. The app validates the ID token, reads your claims, and starts your session.

The back-channel exchange in step four is a real difference. Tokens need not travel through the browser, which suits native mobile apps that have no comfortable way to receive a posted form.

Our explainer on single sign-on meaning covers why one login can safely open many apps. OIDC is currently the most common way new apps implement that idea.

Modern OIDC adds PKCE to protect the code exchange, originally for mobile apps that cannot keep a client secret. Browser-based apps now use the same protection.

Refresh tokens extend sessions without fresh sign-ins. The application trades one quietly in the background, which is how a phone app stays signed in for weeks.

How do SAML and OIDC compare side by side?

DimensionSAML 2.0OIDC
Standardised2005, by OASIS2014, by the OpenID Foundation
Data formatXML assertionsJSON web tokens (JWT)
Built onIts own frameworkOAuth 2.0
TransportBrowser redirects and form postsHTTPS redirects plus direct API calls
SetupManual metadata and certificate exchangeDiscovery document and client registration
Best fitEnterprise web SSO, legacy and regulated appsMobile, single-page, and API-driven apps
Also providesRich attribute statements in the assertionAPI authorisation through the same flow

The format row explains most integration war stories. Parsing and signing XML is heavier work than handling JSON, and SAML's flexibility has produced subtle signature mistakes in real products.

Developer experience follows the format row. JSON libraries exist in every language and framework, while correct XML signature handling remains a specialist skill.

Which protocol suits mobile and modern apps?

OIDC, and it is not close. Its tokens are JSON, its calls are ordinary HTTPS, and its flows were designed knowing phones and browser-based apps would use them.

SAML assumes a browser that can receive redirects and auto-submitted forms. A native app can embed a web view to fake that, but the experience and security both suffer.

API-driven systems tilt the same way. When the thing signing in is a service calling other services, OAuth-based flows, and therefore OIDC, are the native pattern.

Before configuring either protocol, list which apps support which. Your app inventory is the natural place to record that, next to each app's owner and renewal date.

Tip

Check the SSO tax before you budget either protocol. Some vendors gate both SAML and OIDC behind enterprise tiers, so protocol choice may matter less than plan choice.

Offline behaviour tilts mobile further toward OIDC. Tokens cached on the device let an app re-authenticate when connectivity returns, without replaying a browser ceremony.

Wearables and televisions make the point vividly. Device flows in the OAuth family handle sign-in on hardware with no keyboard, a scenario SAML never contemplated.

Which should you choose for enterprise SSO?

For classic workforce SSO across established SaaS, choose SAML where the app offers it. It is the integration your identity provider and your vendor both know best.

For anything you are building or buying new, prefer OIDC. It will age better, integrate faster, and cover your mobile and API needs in the same configuration.

Expect to run both for years. Our background piece on what is SAML explains why the older standard is not disappearing from enterprise stacks.

Whichever you deploy, protect the result with regular access reviews. A clean sign-in protocol cannot fix permissions that were granted years ago and never revisited.

Negotiate protocol support at purchase time. Adding an app to your shortlist is the moment to confirm it speaks the protocol your provider prefers.

Keep certificates and keys on a renewal calendar too. An expired SAML signing certificate locks everyone out at once, a failure entirely of housekeeping.

Migration between them is possible but rarely urgent. Providers translate at the boundary for years, so estates usually switch protocol only when an application is replaced.

Test with your hardest application before committing. The legacy tool with the eccentric SAML implementation, not the flagship app, decides how painful standardisation gets.

Sources

Frequently asked questions

Is OIDC replacing SAML?

Gradually for new applications, because OIDC is lighter and built for mobile and API-driven apps. SAML remains deeply embedded in enterprise SSO, and many established applications support only SAML, so most organisations run both.

What is the main technical difference between SAML and OIDC?

Format and foundation. SAML exchanges signed XML assertions through the browser and stands alone. OIDC exchanges JSON web tokens, specifically an ID token, and is built as an identity layer on top of OAuth 2.0.

Which is easier to set up, SAML or OIDC?

OIDC, generally. It offers a standard discovery document and client registration, while SAML integrations usually require manually exchanging metadata files and certificates between the identity provider and each application.

Can one identity provider support both SAML and OIDC?

Yes. Most enterprise identity providers support both protocols from the same console, so you can run SAML for established web apps and OIDC for mobile and modern apps side by side.

Which protocol is more secure, SAML or OIDC?

Neither is inherently more secure; implementation decides. SAML's risks cluster around XML signature validation and expiry checks, while OIDC implementations must enforce values like nonce and state to prevent replay and forgery.