Skip to content
atlas

SAML

Also known as: Security Assertion Markup Language, SAML 2.0

An older, widely used standard for passing a signed “this user has logged in” message from an identity provider to an app.

Draft - this entry has not been reviewed yet.

Formal

An open standard in which an identity provider, after authentication, sends the user's browser to the app carrying a signed document, called an assertion, that states who the user is and facts about them; the app checks the signature and trusts it.

In plain English

Like a sealed letter of introduction from your employer - the hotel does not know you, but it knows the seal and lets you in.

In practice

A nurse at a regional hospital clicks the icon for the shift-planning system, is sent briefly to the region's login page, and lands back in the planning system already logged in - the SAML message did the work in between.

Why it matters

It lets organisations connect hundreds of business apps to one login and one place to close accounts, and much of the enterprise world still runs on it.

Technical deep dive

SAML is an OASIS standard: version 1.0 was approved in November 2002, and SAML 2.0 in March 2005, merging SAML 1.1, the Liberty Alliance ID-FF 1.2 and Shibboleth work. The 2.0 specification set is split into Core (assertions and protocols), Bindings, Profiles, Metadata and conformance documents. An assertion is an XML document issued by an IdP containing a Subject with a NameID (persistent, transient, emailAddress or unspecified format) and SubjectConfirmation data, Conditions (NotBefore, NotOnOrAfter, AudienceRestriction), and statements: an AuthnStatement with AuthnInstant, SessionIndex and an AuthnContextClassRef describing how the user authenticated, and usually an AttributeStatement carrying attributes such as email, groups or employee number.

The Web Browser SSO profile is what most deployments use. In the SP-initiated variant the service provider creates an AuthnRequest and sends it through the HTTP-Redirect binding (DEFLATE-compressed, base64-encoded, URL-encoded, with any signature carried in query parameters), preserving application state in RelayState. The IdP authenticates the user and returns a Response through the HTTP-POST binding, as an auto-submitting HTML form aimed at the SP's Assertion Consumer Service URL. The Artifact binding instead passes a short reference that the SP resolves over a back channel with SOAP. IdP-initiated SSO sends an unsolicited Response with no InResponseTo to check, which weakens protection against replay and login injection.

Security rests on XML Signature. The Response, the Assertion or both carry an enveloped signature whose Reference points to an ID attribute, computed over exclusive canonicalisation. That indirection enables XML Signature Wrapping: Somorovsky and colleagues ("On Breaking SAML", USENIX Security 2012) found 11 of 14 frameworks they tested vulnerable to injecting an unsigned assertion next to the signed one. In 2018 Duo Labs showed that XML comments inside a NameID could make several libraries read a truncated identity. A correct SP processes only the element whose signature it verified, checks Destination, Recipient, Audience, validity window with small clock skew and InResponseTo, keeps a replay cache of assertion IDs and disables DTD processing to prevent XXE. EncryptedAssertion with AES-CBC has been broken by chosen-ciphertext attacks, so AES-GCM is preferred. Theft of the IdP's signing key enables Golden SAML forgery.

Operationally, trust is configured by exchanging metadata with entity IDs, endpoints and certificates, and certificate rollovers are a common cause of outages. Single Logout exists but is unreliable across many SPs. SAML suits browser-based enterprise SaaS and is weak for native mobile apps and APIs, where OpenID Connect and OAuth fit better. In Denmark, the OIOSAML profiles (currently 3.0.3 alongside 2.1.0) govern integration with NemLog-in, and the research federation WAYF also builds on SAML.

What to learn first

Everything this builds on, foundations first.

  1. Cryptographic key
  2. →Hashing
  3. →Digital identity
  4. →Credential
  5. →Public-key cryptography
  6. →Authentication
  7. →Digital signature
  8. →Identity provider
  9. →SAML

Relationships

Alternative to
OpenID Connect (OIDC)

Sources & further reading

Where this data comes from

This entry was drafted by an AI from the sources above and has not yet been checked by a person. Treat it as a starting point, and check anything important against the sources.

See the review queueSuggest a correction on GitHubThis term as JSON

Check yourself

Loading…

Atlas is in beta.