Chat with us, powered by LiveChat

What Is SAML? How SAML Works, How SAML Is Used, and Where It Breaks

What Is SAML? How SAML Works, How SAML Is Used, and Where It Breaks

SAML (Security Assertion Markup Language) is an open XML standard that lets an identity provider tell a separate application that a user has already signed in, so the user does not log in again. The identity provider sends a digitally signed message called a SAML assertion; the application verifies the signature and grants access. The current version, SAML 2.0, has been an OASIS Standard since March 2005 and still powers most enterprise single sign-on (SSO) to SaaS apps.

Quick factsDetail
PartiesIdentity provider (IdP), service provider (SP), user’s browser
Message formatXML with an XML signature
What the app never seesThe user’s password, MFA code, or passkey
What SAML does not doCreate, update, or delete user accounts
Setup difficultyModerate to connect a SaaS app; high to build an SP from scratch

How Does SAML Work?

Here is how SAML works in the most common pattern, SP-initiated SAML SSO:

  1. User opens the app. The browser requests app.example.com with no active session.
  2. The app sends an AuthnRequest. The SP creates a request with a unique ID and redirects the browser to the IdP.
  3. IdP authenticates the user. The IdP performs password, MFA, or passkey checks here.
  4. IdP returns a signed response. It contains an assertion naming the user, the target app, a validity window, and optional attributes.
  5. Browser posts the response to the app. An auto-submitting form delivers it to the SP’s Assertion Consumer Service (ACS) URL.
  6. The app validates and logs the user in. The SP checks the signature against the IdP certificate it stored earlier, then checks time, audience, and recipient.

All trust rests on the IdP signing certificate exchanged before the first login. Whoever holds that private key can mint valid logins for every connected app.

What Is Inside a SAML Assertion?

The SAML 2.0 core specification defines three statement types: authentication, attribute, and authorization decision. The simplified assertion below marks the fields an app must check and the attack each check blocks.

SP-Initiated or IdP-Initiated: Which Should You Enable?

FactorSP-initiatedIdP-initiated
Starts fromThe app’s login pageAn app tile on the IdP dashboard
InResponseTo checkPossibleImpossible (no request exists)
Injection riskLowerHigher, because the app accepts unsolicited responses
Deep linksSupported via RelayStateLimited
VerdictDefaultEnable only if users need dashboard launch, with strict replay caching

How Is SAML Used?

How is SAML used in practice? It fits wherever an organization, not the individual user, controls identity. The SAML 2.0 profiles specification defines the Web Browser SSO profile behind nearly all of these deployments.

Use caseWho configures itTypical attributes
Employee SSO to SaaS (CRM, HR, ticketing)Corporate IT via Entra ID, Okta, Google Workspace, or PingEmail, name, groups
Cloud console federation (AWS, Google Cloud, Azure)Cloud and security teamsRole mapped to cloud permissions
“Enterprise SSO” inside your own B2B SaaS productYour engineers as SP; each customer’s IdPEmail, customer-defined roles
University research federationsCampus identity officesAffiliation (student, faculty, staff)
Government and contractor portalsAgency identity programsIdentifier tied to an assurance level

How Do You Set Up SAML Authentication for One App?

SAML authentication between one IdP and one app takes five configuration steps. If you have not picked a platform yet, start with how to choose an identity provider.

  1. Create the app in the IdP. Enter the app’s entityID and ACS URL, found in the app’s SSO settings or SP metadata.
  2. Choose the NameID. Use a stable, unique identifier (email or immutable user ID) that matches accounts in the app.
  3. Map attributes. Send only what the app needs, such as email and group, to limit data exposure.
  4. Import IdP metadata into the app. This loads the IdP entityID, SSO URL, and signing certificate.
  5. Test with a non-admin account first. Keep a local break-glass admin login until SSO is proven.

Why Doesn’t SAML Remove Access When Someone Leaves?

SAML only answers “who is logging in right now.” It never tells an app that a user was fired, renamed, or moved teams. Disabling a user in the IdP blocks new SAML logins, but existing app sessions, local passwords, and API tokens can stay active.

GapSAML aloneSAML plus SCIM
Account created before first loginNo (requires just-in-time creation on login)Yes
Role change pushed to the appOnly at the next loginImmediately
Account deactivated on offboardingNoYes

The fix is SCIM, an IETF standard for provisioning and deprovisioning accounts across domains. When buying SaaS, ask for SAML and SCIM together; without one, you leave an offboarding gap. Our SCIM provisioning guide covers setup.

SAML vs OAuth vs OpenID Connect: Which One Fits?

CriterionSAML 2.0OAuth 2.0OpenID Connect
JobLog a user into a web appGive an app scoped access to an APILog a user into any app
TokenSigned XML assertionAccess tokenSigned JSON ID token
Mobile and single-page appsWeak (browser form POST)StrongStrong
Enterprise SaaS supportNear-universalNot a login protocol aloneBroad and growing
Parsing riskHigh (XML signatures)Implementation-dependentLower (JSON)

SAML vs OAuth decision rule: They solve different problems. OAuth 2.0 grants API access; it does not prove who the user is. Use SAML when enterprise customers require it for workforce login. For a new app with no SAML requirement, OpenID Connect is simpler to build and maintain. See the full SAML vs OIDC comparison for migration trade-offs.

Why Does SAML Security Matter More in 2026?

SAML cuts the number of passwords attackers can steal, but it concentrates risk in two places: the IdP signing key and each app’s validation code.

  • Attackers shifted to exploiting software. The 2026 Verizon Data Breach Investigations Report found vulnerability exploitation rose to 31% of breach initial access, while credential abuse fell to 13%. Only 26% of critical CISA KEV vulnerabilities were fully remediated in 2025, down from 38% the prior year. For SAML, patching your SSO library now matters as much as protecting passwords.
  • Stolen signing keys bypass MFA. In Golden SAML attacks documented by CISA, an actor compromised federated identity systems and used forged authentication tokens to move into Microsoft cloud environments. The forged tokens pass every check because they carry a real signature.
  • Validation code fails silently. In 2025, ruby-saml versions before 1.12.4 and 1.18.0 allowed authentication bypass because two XML parsers read the same message differently, enabling signature wrapping.

Explore more: STRIDE Threat Model: Definition, Framework, and How to Use It

What Should a SAML Security Checklist Include?

#CheckBlocks
1Verify the signature only with the IdP certificate from stored metadataAttacker-supplied keys
2Confirm the signed element is the exact element your code readsSignature wrapping
3Use one XML parser for verification and data extractionParser differentials
4Match Issuer to the expected IdPCross-tenant reuse
5Match Audience to your entityIDAssertions for another app
6Match Recipient and Destination to your ACS URLRedirected assertions
7Enforce NotBefore and NotOnOrAfter with small clock skewReplay of old assertions
8Require InResponseTo to match an open requestUnsolicited injection
9Cache assertion IDs until expiry and reject repeatsReplay inside the window
10Disable DTDs and external entitiesXXE attacks
11Alert before IdP certificate expiry; rotate on scheduleOutages and key-theft persistence
12Patch the SAML library on your fastest security cadenceKnown bypasses

Items 2 and 3 are where hand-built implementations fail most often. Use a maintained library or identity platform instead of parsing XML yourself.

Delve into the details of: Cybersecurity Interview Questions That Actually Get Asked in 2026

How Do You Fix Common SAML Login Errors?

SymptomLikely causeFix
“Invalid signature” after months of workingIdP signing certificate rotated or expiredRe-import IdP metadata into the app
“Audience mismatch”entityID differs, often by a trailing slash or http vs httpsMake IdP and app values identical
“Assertion expired” or “not yet valid”Server clock driftSync servers with NTP
“Invalid recipient” or “Destination mismatch”Wrong ACS URL in the IdPCopy the ACS URL from SP metadata
Login succeeds but user has no accessAttribute name or group value not mappedMatch attribute names exactly in both systems
“User not found”NameID format differs from app accountsAlign NameID with the app’s unique identifier
Works from dashboard, fails from app (or reverse)Only one flow enabledEnable the required flow or add RelayState

To inspect a live response, open browser developer tools, find the POST to the ACS URL in the Network tab, Base64-decode the SAMLResponse value, and compare each field against the table above.

<!– EDITOR: insert a real screenshot here of a decoded SAMLResponse from your own test tenant (blur tenant IDs and emails). Suggested alt text: “Decoded SAML response in browser developer tools showing Issuer, Audience, and NotOnOrAfter fields”. –>

How Does NIST SP 800-63C-4 Grade SAML Federations?

US agencies and many federal contractors measure federation strength with NIST SP 800-63C-4, published July 2025 and superseding SP 800-63C. It rates federations by Federation Assurance Level (FAL).

FALCore expectationSAML implication
FAL1Signed assertion from the IdPStandard signed response with basic validation
FAL2Adds injection protection and a formal trust agreementPrefer SP-initiated flows; enforce InResponseTo; document the trust relationship
FAL3User proves possession of an authenticator bound to the assertionBearer-only SAML is insufficient; a holder-of-key assertion or bound authenticator is required

If a contract cites 800-63-4, confirm the required FAL before enabling IdP-initiated SSO.

What Are SAML’s Limits?

  • XML complexity: Canonicalization and XML signatures create more attack surface than JSON tokens.
  • Browser dependence: The form-POST design makes native mobile apps awkward.
  • Unreliable logout: Single Logout needs every app to respond; one failure leaves sessions open.
  • Certificate outages: One expired IdP certificate breaks login for every connected app at once.

Learn more about: 10 Cyber Security Certifications That Pay $180K+ in 2026

Verdict: Should You Use SAML?

  • Use SAML if you sell to enterprises or connect employees to SaaS apps that already support it, and pair it with SCIM to close the offboarding gap.
  • Choose OpenID Connect for new consumer, mobile, or single-page apps with no SAML requirement.
  • Never hand-build SAML validation. Use a maintained library, apply the 12-point checklist, and patch SAML dependencies as fast as internet-facing systems.
  • Treat the IdP signing key as your most sensitive secret. Restrict access, monitor its use, and test certificate rotation before an outage forces it.

FAQ

Is SAML authentication or authorization?

Primarily authentication. Assertions can carry attributes and authorization decisions, but the app enforces its own permissions.

What is the difference between SAML and SSO?

SSO is the experience of signing in once for many apps. SAML is one protocol that delivers it.

Is SAML still used in 2026?

Yes. Enterprise SaaS vendors and major cloud providers continue to support SAML 2.0 for workforce login.

Does SAML work with passkeys and MFA?

Yes. The IdP performs the passkey or MFA check, and every connected app inherits it through the assertion. Pair SAML with phishing-resistant MFA at the IdP for the strongest setup.

Share: Facebook LinkedIn X
C Cade Miller

Cade Miller is an active Cybersecurity Consultant and technical contributor at Dumpsgate, specializing in cloud security architecture, identity and access management (IAM), and proactive threat detection. Moving beyond theoretical security concepts, Cade draws directly from his ongoing fieldwork and Security Operations (SecOps) experience to deliver highly actionable, research-backed insights. Dedicated to continuous hands-on testing, he regularly evaluates emerging defensive technologies and pursues advanced industry certifications, translating his firsthand experience into battle-tested exam strategies and practical security blueprints for IT professionals.

GDPR