Passwords & identity

SAML Authentication: How SAML SSO Works, With Examples and Risks

SAML is the protocol behind most enterprise single sign-on. Here is how it moves trust from your identity provider to every app you use.

Cysoro Security TeamPublished · 8 min read
IdPSigns you inAppTrusts assertionSigned assertionXML • 5-minute windowPASSWORDS & IDENTITYSAMLauthenticationOne login. Many apps.
Quick answer

SAML authentication is an open standard that lets an identity provider verify a user once and tell other applications who that user is, using a signed XML document called a SAML assertion. The user signs in at the identity provider, the provider sends the assertion through the browser to the application, and the application trusts it and grants access. SAML 2.0, published by OASIS in 2005, remains the leading protocol for enterprise single sign-on.

Key takeaways

  • SAML lets you sign in once at an identity provider and access many apps without a separate password for each one.
  • Trust travels in a signed XML assertion that states who you are, how you authenticated, and when the claim expires.
  • SAML is for enterprise web SSO; OAuth is for authorization and OpenID Connect adds identity to OAuth for newer apps.

You sign in once in the morning, then open Salesforce, Workday and Microsoft 365 without typing another password. That quiet convenience is SAML at work — and it is also a single point of trust worth understanding.

What is SAML authentication?

SAML authentication is an open standard that lets an identity provider verify a user once and then tell other applications who that user is. SAML stands for Security Assertion Markup Language, and it uses signed XML documents to carry that trust.

The identity provider, or IdP, is the system that checks your password, MFA or passkey. The service provider, or SP, is the application you want to use. Instead of giving your password to every app, you prove who you are to the IdP, and the IdP vouches for you to each SP.

SAML 2.0 was published by OASIS in 2005 and remains the most widely used protocol for enterprise single sign-on, as the OASIS SAML 2.0 Technical Overview describes. It is supported by thousands of applications, including Microsoft 365, Salesforce, Google Workspace and Workday, according to Cisco Duo SAML guide.

SAML does not handle authentication itself. It defines how the IdP communicates the result to the SP. The IdP still decides how strongly to check you, for example with MFA or a passkey.

How does SAML authentication work?

SAML authentication follows a sequence of browser redirects between three parties: your browser, the service provider and the identity provider. The whole exchange happens through your browser, and your password never goes to the application.

  1. You request access: you open the application, which finds no session for you.
  2. The SP creates a request: it generates a SAML AuthnRequest and redirects your browser to the IdP.
  3. The IdP authenticates you: you sign in at the IdP with your password, MFA or passkey.
  4. The IdP creates a signed response: it builds a SAML assertion, signs it, and sends it back through your browser to the SP.
  5. The SP validates and grants access: it checks the signature, the audience and the time window, then creates a session for you.

The most common flow is SP-initiated, where you start at the application. There is also an IdP-initiated flow, where you start at the IdP portal and click an app tile. SP-initiated is safer, because the request ties the response to the login you started.

SAML authentication in five steps1RequestYou open the app2RedirectApp sends youto the IdP3Sign inPassword, MFAor passkey4AssertionIdP signs andsends proof5AccessApp checksand lets you in
Your password stays at the identity provider; the app trusts the signed assertion. Illustration by Cysoro.

What is a SAML assertion?

A SAML assertion is a signed XML document in which an identity provider tells a service provider who a user is, how and when they authenticated, and which attributes they carry. It travels inside a SAML Response, and the SP may only trust it after checking the signature, the issuer, the audience and the time window.

An assertion contains three types of statements. Authentication statements say when and how you authenticated. Attribute statements carry user data such as email, name, role and group membership. Authorization decision statements, where used, say what you are allowed to access.

Two fields protect the assertion. Conditions carry NotBefore and NotOnOrAfter timestamps that define a short validity window, often about five minutes. Audience restriction names the SP the assertion was issued for, so an assertion for one app cannot be reused at another.

The IdP signs the assertion with its private key. The SP verifies that signature with the IdP public certificate. If the signature is missing or wrong, the SP must reject the assertion.

What are the key SAML terms?

SAML has its own vocabulary, and most confusion comes from the terms, not the idea. Learn these five and the rest of the protocol reads clearly.

TermWhat it is
PrincipalThe user trying to sign in
Identity provider (IdP)The system that verifies the user and issues assertions
Service provider (SP)The application that trusts the assertion and grants access
AssertionThe signed XML claim about the user
Assertion Consumer Service (ACS)The SP endpoint that receives the SAML response
MetadataThe exchanged configuration: endpoints, certificates and entity IDs
BindingHow messages travel, usually HTTP Redirect for requests and HTTP POST for responses

Bindings matter in practice. HTTP Redirect carries data in URL query parameters and is used for AuthnRequests. HTTP POST carries data in a form and is used for SAML responses, because assertions are too large and too sensitive for a URL.

SAML vs OAuth vs OIDC: what is the difference?

SAML, OAuth 2.0 and OpenID Connect are often confused because they all move identity between systems. They solve different problems, use different formats, and fit different apps.

FeatureSAML 2.0OAuth 2.0OpenID Connect
PurposeAuthentication and SSOAuthorizationAuthentication on top of OAuth
FormatXML assertionsJSON, access tokensJSON, ID tokens (JWT)
Best forEnterprise web SSOAPI access on behalf of a userModern web and mobile SSO
Typical useWorkforce appsLetting an app read your calendarSign in with Google or Microsoft
AgePublished 2005Published 2012Published 2014

A simple rule helps: SAML proves who you are to an app. OAuth lets an app do something on your behalf without your password. OpenID Connect proves who you are using OAuth, with a compact JSON token instead of XML.

Many modern apps support both SAML and OIDC. Enterprise buyers often choose SAML for workforce apps because it is widely supported and well understood by IT teams. Newer consumer and mobile apps often choose OIDC because it is lighter and JSON-based.

What are the benefits of SAML?

The main benefit is one login for many apps. Users sign in once, IT manages one set of accounts, and each app trusts the same identity provider. That reduces password fatigue and the number of passwords an attacker can steal.

SAML also centralizes policy. MFA, session length, conditional access and account lockout can be enforced at the IdP, and every connected app inherits them. If you leave a company, disabling one IdP account cuts access to all connected apps at once.

For businesses, SAML reduces helpdesk load. Fewer passwords mean fewer resets, and a single logout can end sessions across apps where Single Logout is supported. That matters when a device is lost or an employee leaves.

There is a trade-off: the IdP becomes a single point of trust. If it is compromised or misconfigured, many apps are affected at once. That is why the IdP deserves your strongest protection, including phishing-resistant MFA.

What are the security risks of SAML?

SAML is only as safe as its configuration. The most dangerous mistakes are skipping signature validation, accepting assertions for the wrong audience, or trusting an assertion outside its time window. Each of those checks exists to stop a specific attack, such as forgery, replay or cross-tenant injection.

Other risks include stolen IdP credentials, misconfigured attributes that grant the wrong role, and IdP-initiated flows without a request to tie the response to. In an IdP-initiated flow there is no AuthnRequest, so there is no InResponseTo field to check, which weakens replay protection.

Certificate handling is another common failure. If a certificate expires and nobody notices, SSO stops working. If a certificate is replaced without updating the SP, the SP may reject valid assertions or, worse, trust the wrong one.

Protect SAML the same way you protect any identity system: enforce MFA at the IdP, use short assertion lifetimes, encrypt assertions where sensitive attributes travel, and review who can change IdP and SP configuration. CISA recommends phishing-resistant MFA for exactly this reason.

SAML security checklistVerify the signatureReject any assertion with a bador missing signature.Check audience and timeOnly accept assertions for yourapp, inside the window.Enforce MFA at the IdPOne strong login protectsevery connected app.Watch certificatesTrack expiry dates androtate them on time.
Four checks that stop most SAML attacks. Illustration by Cysoro.

How do you set up SAML SSO?

Setup is a trust exchange between the IdP and the SP. Each side shares metadata — endpoints, entity IDs and certificates — and each side stores the other trust. The steps are similar across providers, even if the screens differ.

  1. In the SP, create a SAML app and note its entity ID and ACS URL.
  2. In the IdP, create the matching app and paste in the SP entity ID and ACS URL.
  3. Exchange certificates: copy the IdP signing certificate into the SP, and confirm the SP metadata in the IdP.
  4. Map attributes: decide which fields the SP needs, such as email, name and group, and map them from the IdP.
  5. Test with one user before you roll it out, and check that roles and groups arrive as expected.
  6. Turn on MFA and session policy at the IdP, and set a calendar reminder for certificate expiry.

Test the failure cases too: a user with no group, a user with the wrong role, and a login after the certificate changes. Those are the cases that cause support tickets after launch.

If SAML fails, check the clock first. SAML assertions have a short validity window, so a server clock that drifts by a few minutes can cause valid logins to fail. Then check the entity ID, audience and certificate.

What does a SAML login look like in practice?

Imagine you work at a company that uses Okta as its IdP and Salesforce as its SP. You open Salesforce in your browser. Salesforce sees no session, so it redirects you to Okta with a SAML AuthnRequest.

You sign in at Okta with your password and a push approval. Okta builds a SAML assertion that says you are [email protected], you authenticated with MFA at 9:02, and you belong to the Sales group. It signs the assertion and posts it back to Salesforce.

Salesforce checks the signature against the Okta certificate, confirms the audience is Salesforce, confirms the time window, reads your group, and creates a session. You are in Salesforce without typing a Salesforce password.

Later you open Workday. Workday redirects you to Okta, Okta sees you already have a session, and it issues a new assertion for Workday without asking you to sign in again. That is single sign-on.

For a wider view of identity protection, our guide to spotting a hacked phone helps you notice when a trusted device is no longer safe.

You can also test whether a password you use has appeared in a breach with our pwned password checker.

The bottom line

SAML authentication moves trust, not passwords. Your identity provider proves who you are once, and each application trusts a signed, time-limited assertion instead of asking for your password again.

That convenience is worth it, but only if the IdP is protected and the configuration is checked. Enforce phishing-resistant MFA, validate signatures and audiences, and watch certificate expiry. You can start by checking the passwords behind your main accounts with the free password strength checker.

Frequently asked questions

What is SAML authentication?

SAML authentication is a way for an identity provider to prove who you are to an application, using a signed XML assertion. You sign in once at the identity provider, and each application trusts that proof instead of asking for your password again.

What does SAML stand for?

SAML stands for Security Assertion Markup Language. It is an open standard from OASIS for exchanging authentication and authorization data between an identity provider and a service provider.

Is SAML the same as SSO?

No. SSO, or single sign-on, is the goal: sign in once and access many apps. SAML is one protocol that delivers SSO, mainly for enterprise web apps. Other protocols, such as OpenID Connect, can also deliver SSO.

What is a SAML assertion?

A SAML assertion is a signed XML document from an identity provider that states who a user is, when and how they authenticated, and what attributes they carry, such as email, name and group membership. It also carries a time window and an audience so only the intended app can use it.

What is the difference between SAML and OAuth?

SAML is mainly for authentication and enterprise SSO, using XML assertions. OAuth 2.0 is mainly for authorization: letting an app act on your behalf without sharing your password. OpenID Connect builds on OAuth to add authentication with JSON tokens.

Is SAML secure?

SAML can be secure when it is configured well, with signed and encrypted assertions, short validity windows, and a trusted identity provider. Misconfiguration, such as skipping signature checks or accepting assertions for the wrong audience, is a common source of real breaches.

Do I need SAML for a small business?

Not always. Small teams often start with their identity provider built-in SSO or OpenID Connect. SAML becomes useful when you need enterprise apps such as Salesforce, Workday or Microsoft 365 to trust one central login, or when a customer requires it.

What happens when SAML SSO fails?

Common causes are clock drift between systems, an expired certificate, a wrong entity ID or audience, or a missing attribute the app expects. Check the identity provider logs first, then the app logs, and confirm the certificate and time settings match.

Sources

  1. Cisco Duo — SAML authentication explained: how SSO works
  2. Cisco Duo — SAML vs OAuth vs OIDC: Key differences explained
  3. OASIS — SAML 2.0 Technical Overview
  4. NIST — Digital Identity Guidelines (SP 800-63B)
  5. CISA — Phishing Guidance: Stopping the Attack Cycle at Phase One
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against the OASIS SAML 2.0 Technical Overview, Cisco Duo SAML guides, NIST SP 800-63B and CISA phishing guidance.

How we write and fact-check →

Free tools for this topic

No account needed.

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free