Antonio Braccolino, Identity & Access, home

Lab · 03 / 16

Two ways to say it is me.

In companies you meet both every day. SAML runs most enterprise web SSO built in the last twenty years, OpenID Connect is the default for anything new, especially mobile apps and APIs.

You completed every lab

All 16 labs, from the map of IAM to the reference architectures. Identity has no secrets left for you.

See your achievements

Share your badge

Instagram: download the image and post it as a post or story. LinkedIn: the text is copied when you open it, paste it and attach the image.

SAML 2.0 · OpenID Connect · Intermediate · 8 differences

What you will learn

  • How the two formats differ
  • Why OIDC fits mobile apps and APIs better
  • What to check when you integrate SAML

In plain words Both are a signed letter from the IdP saying "this is Ada". SAML writes it in XML and hands it over through the browser; OIDC writes it as a compact JSON token and also gives the app a key for APIs.

SAML 2.0XML assertionsOpenID ConnectJSON tokens
Born2005, OASIS2014, OpenID Foundation
FormatXML assertion, XML signatureJWT (JSON), JWS signature
RolesIdentity provider and service providerOpenID provider and relying party (client)
TransportBrowser redirects and auto-submitted POST formsRedirects plus direct calls to the token endpoint
Mobile and SPAAwkward, designed for the browserNative, with PKCE
Calling APIsNot covered, needs another protocolAccess token from the same flow
SetupExchange XML metadata and certificatesDiscovery URL and automatic key rotation (JWKS)
Where you find itEnterprise SaaS, legacy portals, governmentNew apps, mobile, consumer sign-in, APIs

When to use SAML 2.0

Use SAML when the app only supports SAML, which is still common for enterprise SaaS. It is mature and well understood by auditors.

When to use OpenID Connect

Use OpenID Connect for every new app you build, and for mobile, single-page apps and anything that calls APIs.

The most common mistake

Trusting a SAML response without strict checks. The service provider must verify the signature on the assertion itself, and check Audience, Recipient, time window and that the signed element is the one it reads. Weak XML signature handling has caused real breaches.

Side by side

SAML 2.0
<saml:Assertion ID="_a75adf55" IssueInstant="2026-10-19T08:00:00Z">
  <saml:Issuer>https://idp.example.com</saml:Issuer>
  <ds:Signature>…</ds:Signature>
  <saml:Subject>
    <saml:NameID>ada@example.com</saml:NameID>
  </saml:Subject>
  <saml:Conditions NotOnOrAfter="2026-10-19T08:05:00Z">
    <saml:Audience>https://app.example.com</saml:Audience>
  </saml:Conditions>
</saml:Assertion>
OpenID Connect
{
  "iss": "https://idp.example.com",
  "sub": "248289761001",
  "aud": "web-app",
  "iat": 1760860800,
  "exp": 1760861100,
  "email": "ada@example.com"
}

// signed with a key published at
// /.well-known/jwks.json