What Is SAML and How Does SAML Authentication Work? (Explained Clearly)
How does SAML authentication work? Follow the SSO login flow, understand signed assertions and security checks, and troubleshoot common sign-in issues.
π Master your Security+ skills with Pluralsight here: Pluralsight
Youβll learn what SAML is and how SAML authentication works, from single sign-on (SSO) to identity providers, service providers, and signed assertions. Build your CompTIA Security+ foundation so you can follow a SAML login, understand its security checks, and troubleshoot common issues.
Chapters: 0:00 Intro 0:14 What is SAML, and why do companies use it? 1:09 How does a SAML login work step by step? 2:21 What makes a SAML assertion safe to accept? 3:25 What doesnβt SAML do automatically? 4:25 Outro
Affiliate notice: Some links may earn a commission. Thanks for your support.
Key Takeaways
SAML enables federated single sign-on using XML assertions. An identity provider (IdP) authenticates the user; a service provider (SP) trusts the verified result rather than receiving the userβs organizational password.
The login flow is request β authentication β assertion β validation β session. The browser carries messages between systems, delivering the IdPβs response to the applicationβs Assertion Consumer Service (ACS).
SSO reuses the IdP session, not one assertion everywhere. Each application receives its own SAML response and typically creates its own local session.
A valid signature alone is not enough. Applications must also check issuer, audience, recipient, timing, request correlation where applicable, and replay protection. See OWASPβs validation guidance.
Signing is not encryption, and Base64 provides no secrecy. Signatures protect authenticity and integrity; encryption protects confidentiality; HTTPS protects transport.
SAML does not automatically manage permissions, offboarding, or session termination. Assertion expiration does not end an existing application session, and disabling an IdP account may only prevent new logins.
Troubleshoot the stage that failed. Check endpoints and entity IDs, signing certificates, clock synchronization, required attributes, and role mappings; never upload production assertions to untrusted decoding tools.
π Turn understanding into hands-on practice with Pluralsight, an optional next step offering guided security labs, feedback, assessments, and certification practice exams.
SAML authentication lets an application trust a login performed by an identity provider instead of checking your organizational password itself. The identity provider sends a security statement, and the application verifies it before creating a session.
That exchange powers many workplace single sign-on experiences. To understand how SAML authentication works, it helps to follow both the login process and the checks that make the result trustworthy.
What Is SAML?
SAML stands for Security Assertion Markup Language. It is an open, XML-based standard for exchanging security information between systems. XML, or Extensible Markup Language, is a structured text format.
SAMLβs best-known use is : allowing an application to rely on authentication performed by a trusted identity provider. This article focuses on SAML 2.0 Web Browser SSO.
Some links may earn a commission. Thanks for your support.
Watch in the video playerOpen the dedicated player for this video.
federated single sign-on (SSO)
Three related terms explain its purpose:
Authentication: Establishing who a user is.
Authorization: Deciding what that user may access.
Federation: Allowing one system or security domain to rely on identity information from another.
SAML connects these systems without requiring each application to perform its own primary authentication. It does not simply pass the userβs password from application to application.
The OASIS SAML technical overview describes how assertions, protocols, and message bindings work together to support this exchange.
The Main Participants in SAML Authentication
A typical SAML login involves three principal roles:
Participant
Role
Example
Principal
The entity being authenticated, usually a person
An employee opening an expense application
Identity provider (IdP)
Authenticates the user and issues identity assertions
The organizationβs corporate identity system
Service provider (SP)
Accepts a trusted assertion and provides the application
The expense application
The browser carries messages between the IdP and SP in the common browser-based flow. It does not decide whether an assertion is trustworthy; the service provider must validate it.
Trust Is Configured Before Login
An application does not trust an assertion just because it contains plausible identity information.
Administrators establish the federation relationship in advance. Configuration commonly includes:
The identifiers of the IdP and SP.
The IdPβs sign-in endpoint.
The SPβs response endpoint.
The public key or certificate used to verify signatures.
The identity attributes the application expects.
These details are often exchanged through SAML metadata, an XML configuration document containing identifiers, endpoints, and key information.
The IdPβs signing certificate provides a public verification key. Its private signing key must remain protected.
How Does SAML Authentication Work Step by Step?
Consider an employee, Maya, opening a company expense application. In this example, the login starts at the application, making it an SP-initiated SAML flow.
1. The User Opens the Application
Maya requests the expense application. The SP checks whether she already has an acceptable application session.
If she does not, the application begins the SAML authentication process.
2. The Application Creates an Authentication Request
The SP creates an AuthnRequest. This message identifies the requesting application and includes a request identifier.
The application then sends Mayaβs browser to the identity provider. HTTP Redirect is a common way to carry this request.
3. The Identity Provider Authenticates the User
The IdP checks whether Maya already has an active IdP session.
If not, it asks her to authenticate. Depending on organizational policy, that might involve a password, passwordless authentication, or multifactor authentication (MFA).
SAML does not mandate one particular login method. It communicates the authentication result rather than defining every step used to establish it.
4. The IdP Issues a SAML Response
After successful authentication, the IdP creates a SAML response containing an assertion about Maya.
The assertion can identify her, describe the authentication event, include configured attributes, and restrict where and when it may be accepted.
5. The Browser Delivers the Response to the Application
The browser submits the response to the SPβs Assertion Consumer Service (ACS).
The ACS is the endpoint that receives and processes SAML responses. A common implementation uses an HTML form and HTTP POST for this delivery.
6. The Application Validates the Response and Assertion
The application checks the applicable digital signature and other restrictions. These include whether the assertion came from the expected IdP, was intended for this application, and remains within its validity window.
For an SP-initiated exchange, it also checks the connection to the original request where required.
7. The Application Creates Its Own Session
If validation succeeds and the user meets the applicationβs access requirements, the SP establishes a local session, typically maintained with an application session cookie.
Subsequent application requests generally use that session rather than repeating the full SAML exchange.
User opens application
|
v
Application sends browser to IdP
|
v
IdP authenticates user or recognizes existing session
|
v
Browser carries SAML response to application's ACS
|
v
Application validates assertion and access rules
|
v
Application creates its own session
In this flow, organizational credentials go to the IdPβs authentication process, not to the service provider.
The expense application receives an assertion about the authentication result, not Mayaβs organizational password.
How Does This Enable Single Sign-On?
When Maya opens another connected application, that application can begin a new SAML exchange. The IdP may recognize her existing session and issue a new response without prompting her to sign in again.
Each application can still maintain its own session.
SSO therefore does not mean one assertion is accepted everywhere. It means an existing IdP session can support authentication to multiple trusted applications.
What Does a SAML Assertion Contain?
A SAML response and a SAML assertion are related but different:
The response is the protocol message.
The assertion is a security statement carried inside it.
Typical assertion information includes:
Component
What it tells the application
Issuer
Which identity provider issued the assertion
Subject / NameID
Whom the assertion concerns
Authentication statement
Information about the authentication event
Attributes
Configured details such as department or group membership
Audience restriction
Which service provider is an intended consumer
Time restrictions
When the assertion may be accepted
Subject confirmation
Conditions governing how the assertion may be presented
For example, an assertion might communicate the following information:
Issuer: Corporate identity provider
Subject: employee-4821
Authenticated at: 09:00 UTC
Intended audience: Expense application
Accept before: 09:05 UTC
Department: Finance
This is a teaching example, not valid SAML XML.
The application must validate the actual signed message. A recognizable username or believable department value is not proof that the assertion is authentic.
What Makes a SAML Assertion Safe to Accept?
A valid digital signature is necessary, but it is not sufficient. The application must also determine whether the signed information is appropriate for this application and login transaction.
Important checks include:
Check
Why it matters
Signature
Verifies the origin and integrity of the signed content using a trusted key
Issuer
Confirms the assertion came from the expected IdP
Audience
Confirms the assertion is intended for this SP
Recipient and destination
Helps ensure the response is delivered and accepted at the correct endpoint
Time restrictions
Rejects assertions that are not yet valid or have expired
Request correlation
Connects the response to the initiating request where applicable
Replay protection
Prevents a captured assertion from becoming a reusable login ticket
A genuine assertion intended for a different application must not be accepted merely because its signature verifies.
Several protections appear in SAML discussions, but they solve different problems:
Digital signatures support authenticity and integrity.
Encryption protects content confidentiality.
Base64 encoding makes data convenient to transport; it does not make it secret.
HTTPS/TLS protects the transport connection.
A Base64-encoded SAML response is not encrypted simply because it looks unreadable.
Implementation Security Still Matters
SAML implementations must also handle XML safely. For example, XML signature wrapping exploits a mismatch between the content whose signature is verified and the content the application actually uses.
Protecting federation signing keys is equally important. Compromised signing material can allow attackers to forge apparently trusted assertions, a scenario commonly called Golden SAML.
SAML sign-in can begin at either side of the federation relationship.
Flow
Starting point
Important distinction
SP-initiated
Both are recognized patterns. However, IdP-initiated SSO lacks the same initiating-request correlation, so protections against unsolicited-response and login-CSRF problems require particular care.
SAML vs. OAuth, OpenID Connect, LDAP, and SCIM
These technologies appear together in identity architectures, but they are not interchangeable.
For Security+ study, the central distinction is functional: SAML communicates security assertions, OAuth addresses access authorization, and OIDC adds standardized authentication on top of OAuth.
What SAML Does Not Handle Automatically
Centralized sign-in is useful, but it does not make every identity and access task part of the same process.
Application Authorization
Successful authentication establishes an identity. It does not automatically grant administrator privileges, or any particular permission.
The application still applies its own access rules. For example, it might map a Finance attribute to an invoice-processing role.
Account Provisioning and Offboarding
Some applications support just-in-time (JIT) provisioning, creating a local user record from SAML attributes during the first login.
That is an application capability, not a guarantee provided by every SAML integration. It also does not automatically provide account deactivation or deletion.
Provisioning and offboarding require their own supported mechanisms and processes.
Application Session Termination
An assertionβs expiration controls when it may be accepted. It does not automatically determine how long the resulting application session lasts.
Likewise, disabling a user at the IdP may prevent new logins without immediately terminating every existing application session.
SAML defines Single Logout (SLO), but signing out everywhere depends on implementation support, configuration, and successful logout-message delivery.
Common SAML Authentication Problems and How to Troubleshoot Them
A correct password does not prove the SAML integration is working. Authentication at the IdP is only one stage of the process.
Start by identifying where the failure occurs:
Before IdP authentication: Check the sign-in destination and application configuration.
During IdP authentication: Check authentication policy, MFA requirements, and user eligibility.
When the application receives the response: Check trust, identifiers, endpoints, timing, and signature validation.
After successful validation: Check local accounts, attributes, roles, and application permissions.
Common diagnostic possibilities include:
Two configuration values are especially easy to confuse:
Entity ID: Identifies the IdP or SP. It may look like a URL without being a page to visit.
ACS URL: The SP endpoint that receives SAML responses.
When investigating failures, handle captured assertions as sensitive identity data. Avoid uploading production assertions to untrusted third-party decoding tools.
Build Hands-On Identity and Access Management Skills
Understanding the login flow gives troubleshooting a structure: follow the request, identify who authenticated the user, inspect what the application must validate, and separate login success from authorization and session behavior.
If you want to move from recognizing these concepts to applying them, Pluralsight is an optional next step. It provides guided security labs, feedback, assessments, and practice exams to help you find gaps and focus your certification preparation.
Affiliate notice: Some links may earn a commission. Thanks for your support.
What Is OAuth 2.0 and How Does It Work? (Explained Clearly)
Next
FAQ
Quick answers to the questions people usually ask about this topic.
Can users access SAML applications if the identity provider is down?
New SAML logins generally fail if the identity provider cannot authenticate users or issue responses. However, users with valid application sessions may retain access until those sessions expire or require reauthentication. The outcome depends on each application's session policies; an existing IdP session alone does not guarantee access during an IdP outage.
Does SAML single sign-on require MFA every time a user opens an application?
No. SAML does not prescribe how often users must complete MFA. The identity provider may reuse an existing authenticated session, or it may require fresh authentication based on organizational policy and the application's requirements. Using SAML alone does not prove that MFA was performed.
Can changing a user's email address break SAML login?
Yes, if the application uses the email address in the SAML NameID or another attribute to match an existing account. A changed value may prevent account matching or, where just-in-time provisioning is enabled, potentially create a separate account. Before changing identifiers, check the application's account-matching rules and coordinate updates between the IdP and SP. A stable identifier can reduce this risk where supported.
How can I inspect a SAML response safely when troubleshooting?
Use an approved local debugging tool or browser developer tools in a controlled environment, preferably with a test account. Compare the issuer, audience, recipient, timestamps, and request correlation with the expected configuration. Treat captured responses as sensitive: Base64 encoding does not hide their contents, and an unexpired bearer assertion could be abused if other protections fail. Avoid public decoding sites, and remember that reading the XML is not the same as validating its signature.
How do you prevent SAML login failures during signing-certificate rotation?
Coordinate the IdP's signing-key change with updates to the SP's trusted verification certificates. Where supported, configure the replacement certificate before switching keys and use an overlap period. Confirm whether the SP refreshes SAML metadata automatically or requires a manual update, then test a complete login after rotation. Never resolve a certificate mismatch by disabling signature validation. The OWASP SAML Security Cheat Sheet provides additional validation guidance.
How can I turn SAML knowledge into practical Security+ preparation?
Start by explaining a login flow without notes, separating authentication from authorization, and identifying likely causes of failures such as incorrect audiences, expired assertions, or stale signing certificates. For broader hands-on cybersecurity practice, explore Pluralsight as an optional next step. Its guided labs, feedback, assessments, and practice exams can help you identify weak spots and focus your certification preparation.
Affiliate link β I may earn a commission at no additional cost to you.
Jay's Recommendation
Turn understanding into hands-on confidence
You've built the foundations. Pluralsight adds opportunities to practice in guided security labs, get feedback, and check your knowledge with assessments and practice exams, so your next step is more than another video.
π Put concepts to workBuild practical skills with guided security labs and feedback.
π―Find your weak spotsUse assessments to focus on what needs more work.
πCheck your understandingUse practice exams to guide your certification preparation.
π§Give study sessions directionOrganize further learning with curated paths and progress tracking.