SAML 2.0

Master this essential documentation concept

Quick Definition

Security Assertion Markup Language 2.0 - an open standard that enables Single Sign-On (SSO) by allowing identity providers to pass authentication credentials to software applications securely.

How SAML 2.0 Works

sequenceDiagram actor User as End User participant SP as Service Provider
(e.g. Salesforce) participant IdP as Identity Provider
(e.g. Okta / Azure AD) User->>SP: 1. Access protected resource SP->>User: 2. Redirect with SAML AuthnRequest User->>IdP: 3. Forward AuthnRequest (via browser) IdP->>User: 4. Prompt for credentials (if not logged in) User->>IdP: 5. Submit username + password / MFA IdP->>IdP: 6. Validate credentials & build SAML Assertion IdP->>User: 7. Return signed SAML Response (Base64) User->>SP: 8. POST SAML Response to ACS URL SP->>SP: 9. Validate signature & parse Assertion SP->>User: 10. Grant access to resource

Understanding SAML 2.0

Security Assertion Markup Language 2.0 - an open standard that enables Single Sign-On (SSO) by allowing identity providers to pass authentication credentials to software applications securely.

Key Features

  • Centralized information management
  • Improved documentation workflows
  • Better team collaboration
  • Enhanced user experience

Benefits for Documentation Teams

  • Reduces repetitive documentation tasks
  • Improves content consistency
  • Enables better content reuse
  • Streamlines review processes

Making Your SAML 2.0 Configuration Knowledge Searchable

For many technical teams, SAML 2.0 knowledge lives primarily in recorded form — walkthrough sessions of identity provider configurations, onboarding calls explaining SSO flows, or screen-recorded troubleshooting sessions where an engineer steps through assertion mapping and metadata exchange. These recordings capture real expertise, but they create a practical problem: when a new developer needs to understand how your SAML 2.0 setup handles authentication for a specific application, they face a time-consuming search through hours of video footage.

The challenge is especially acute with SAML 2.0 because the configuration details matter precisely. Attribute mappings, entity IDs, and certificate handling are the kinds of specifics that get buried at the 23-minute mark of a recording nobody can easily locate. A team member troubleshooting a failed SSO assertion at 4pm isn't well-served by a video library.

Converting those recordings into structured documentation changes the workflow meaningfully. Your SAML 2.0 configuration steps become searchable text, specific parameters can be cross-referenced, and new team members can navigate directly to the section covering, say, SP-initiated versus IdP-initiated flows — without scrubbing through timestamps. This also makes it easier to keep documentation current when your identity provider settings change.

If your team regularly records sessions covering authentication standards and security configurations, see how video-to-documentation workflows can turn that footage into a reference your whole team can actually use.

Real-World Documentation Use Cases

Federated SSO for Enterprise SaaS Onboarding (e.g., Workday + Azure AD)

Problem

Large enterprises using Azure AD as their IdP struggle to onboard employees into Workday without requiring separate credential management. IT teams spend hours manually provisioning accounts and users forget multiple passwords, leading to helpdesk overload.

Solution

SAML 2.0 federation allows Azure AD to act as the authoritative IdP, issuing signed SAML Assertions to Workday's Service Provider endpoint. Users authenticate once against Azure AD and are seamlessly granted access to Workday without a separate login.

Implementation

["Register Workday as an Enterprise Application in Azure AD, configuring the Entity ID (e.g., https://www.workday.com) and ACS URL provided by Workday's SAML setup wizard.", 'Map Azure AD user attributes (UPN, department, role) to SAML Assertion attributes expected by Workday, such as wd:Worker_ID and email.', "Export the Azure AD Federation Metadata XML and upload it into Workday's Edit Tenant Setup – Security page to establish trust.", "Test the SP-initiated SSO flow using a pilot user group and validate that the SAML Response signature passes Workday's certificate verification before full rollout."]

Expected Outcome

Zero separate Workday passwords for 10,000+ employees; helpdesk tickets for password resets drop by ~60%; new employee access is provisioned automatically on first login.

University Portal SSO Using Shibboleth IdP for Student and Faculty Access

Problem

Universities run dozens of separate systems (LMS, library databases, research portals) each requiring individual logins. Students and faculty experience login fatigue, and IT departments struggle to enforce consistent MFA policies across all platforms.

Solution

SAML 2.0 with a Shibboleth Identity Provider centralizes authentication against the university's LDAP/Active Directory. Each campus application registers as a Service Provider in the Shibboleth federation, receiving signed Assertions containing the user's eduPersonPrincipalName and affiliation attributes.

Implementation

['Deploy Shibboleth IdP and configure it to authenticate against the campus LDAP, mapping attributes like eduPersonAffiliation (student/faculty/staff) to outgoing SAML Assertion attributes.', 'Register each SP (Canvas LMS, JSTOR, lab booking system) in the Shibboleth metadata registry with their Entity IDs and ACS URLs.', 'Configure attribute-release policies in Shibboleth so that only necessary attributes are shared per SP (e.g., send full name and email to Canvas, but only anonymous persistent ID to research databases).', 'Enable MFA at the IdP layer using Duo Security so all SAML-authenticated sessions inherit the MFA requirement without per-application configuration.']

Expected Outcome

Single login grants access to 40+ campus services; MFA compliance rises to 98% without per-app configuration; attribute-release policies satisfy FERPA data-sharing requirements.

B2B Customer Portal SSO for Multi-Tenant SaaS Product (SP-Initiated Flow)

Problem

A SaaS vendor serves 200+ enterprise customers, each with their own corporate IdP (Okta, Ping, ADFS). Customers demand SSO as a contract requirement, but supporting each customer's unique IdP configuration without a scalable framework creates engineering bottlenecks.

Solution

The SaaS product implements SAML 2.0 as a Service Provider, dynamically routing SP-initiated AuthnRequests to the correct customer IdP based on the user's email domain. Each customer uploads their IdP metadata XML into a self-service tenant configuration portal.

Implementation

['Build a tenant configuration screen where customer admins paste their IdP metadata XML (containing the SSO URL, Entity ID, and X.509 signing certificate), eliminating manual engineering work per customer.', "Implement email-domain-based IdP discovery: when a user enters their email at login, the SP resolves the correct IdP Entity ID and constructs a SAML AuthnRequest signed with the SP's private key.", 'Parse incoming SAML Assertions to extract the NameID (persistent or email format) and map it to the internal user record, creating the account on first login (JIT provisioning).', 'Log all SAML Response validation events (signature check, NotBefore/NotOnOrAfter timestamps, AudienceRestriction) to a SIEM for security auditing.']

Expected Outcome

New enterprise customer SSO integrations go from 2-week engineering sprints to self-service setup in under 30 minutes; customer churn due to SSO friction eliminated; audit logs satisfy SOC 2 Type II requirements.

Government Agency Cross-Domain SSO Using SAML 2.0 Federation Metadata

Problem

Multiple government agencies need to share a secure document portal but each agency runs its own IdP (ADFS, Entrust). Bilateral trust agreements between every pair of agencies would require N² integrations and are unmanageable at scale.

Solution

SAML 2.0 federation metadata aggregation (similar to InCommon or eGov federations) allows all agencies to publish their IdP and SP metadata into a central, signed federation metadata aggregate. Each participant trusts the aggregate rather than configuring bilateral relationships.

Implementation

['Each agency registers its IdP and SP metadata with the federation operator, who signs the aggregate metadata XML with a trusted federation key.', "Configure each agency's ADFS or Shibboleth instance to periodically fetch and refresh the federation metadata aggregate, automatically discovering new participants.", 'Define a common SAML attribute profile (e.g., agency code, clearance level, employee ID) that all IdPs must assert, enabling the document portal SP to make authorization decisions without per-agency custom logic.', 'Implement SAML Holder-of-Key subject confirmation for high-assurance transactions requiring proof that the user possesses a specific X.509 client certificate.']

Expected Outcome

50-agency federation managed with a single metadata aggregate instead of 1,225 bilateral configurations; new agency onboarding takes days instead of months; attribute-based access control enforces document classification rules automatically.

Best Practices

āœ“ Always Validate the Full SAML Response Signature Chain, Not Just the Assertion

A common vulnerability is validating only the inner SAML Assertion signature while ignoring whether the outer Response element is also signed. Attackers can wrap a valid signed Assertion inside a malicious Response envelope (XML Signature Wrapping attacks) to escalate privileges. Your SP must verify that the signing certificate matches the IdP's registered certificate and that the signed element covers the critical authentication data.

āœ“ Do: Validate the XML digital signature on both the samlp:Response and saml:Assertion elements, verify the X.509 certificate against the IdP's metadata, and reject any response where the SignedInfo does not cover the entire Assertion.
āœ— Don't: Do not trust a SAML Response solely because an Assertion inside it has a valid signature — always check which XML node is actually covered by the signature's Reference URI.

āœ“ Enforce Short-Lived SAML Assertion Validity Windows and Check Timestamps

SAML Assertions include NotBefore and NotOnOrAfter timestamps that define a validity window. If your SP does not strictly enforce these, a captured Assertion can be replayed hours or days later to gain unauthorized access. Clock skew between IdP and SP servers can cause legitimate Assertions to be rejected, so a small tolerance (typically ≤ 5 minutes) is acceptable but must be explicitly configured.

āœ“ Do: Configure your SP to reject Assertions where the current UTC time falls outside the NotBefore/NotOnOrAfter window, allow a maximum of 5 minutes of clock skew tolerance, and use NTP synchronization on both IdP and SP servers.
āœ— Don't: Do not disable timestamp validation to 'fix' clock skew issues, and do not accept Assertions with validity windows exceeding 1 hour for interactive user sessions.

āœ“ Use a Unique, Unpredictable RelayState and Validate It to Prevent CSRF on SSO Flows

The RelayState parameter in SAML SSO flows is used to redirect users to the originally requested resource after authentication. If the SP does not generate a cryptographically random RelayState and validate it upon receiving the SAML Response, attackers can craft malicious IdP-initiated SSO flows that redirect authenticated users to attacker-controlled URLs or force logins into attacker sessions.

āœ“ Do: Generate a cryptographically random (≄ 128-bit) RelayState value for every SP-initiated AuthnRequest, store it in the user's server-side session, and verify it matches when processing the SAML Response at the ACS endpoint.
āœ— Don't: Do not use predictable RelayState values like sequential integers or URL-encoded destination paths without HMAC protection, and do not blindly redirect to the RelayState URL without validating it against an allowlist of trusted domains.

āœ“ Store IdP Certificates in Metadata and Automate Rotation Before Expiry

SAML trust is anchored to the X.509 certificate the IdP uses to sign Assertions. Hardcoding this certificate in application configuration rather than consuming it from the IdP's metadata XML creates operational risk: when the IdP rotates its signing certificate (often annually), the SP breaks immediately and requires emergency manual reconfiguration. Automated metadata refresh ensures certificate updates are picked up before expiry.

āœ“ Do: Configure your SP to fetch the IdP's federation metadata URL on a scheduled basis (e.g., every 24 hours), extract the current signing certificate from the KeyDescriptor element, and alert when a certificate in the metadata is within 30 days of expiry.
āœ— Don't: Do not paste the IdP's Base64 certificate directly into a config file or database field that requires a deployment or manual admin action to update when the certificate rotates.

āœ“ Implement and Log SAML Single Logout (SLO) to Prevent Session Persistence After IdP Logout

Many SAML deployments implement SSO but neglect Single Logout (SLO), leaving SP-side sessions active after a user logs out of the IdP. This is a significant security gap in shared workstation environments (hospitals, call centers, libraries) where the next user can access the previous user's active sessions. SAML 2.0 defines both SP-initiated and IdP-initiated SLO flows using LogoutRequest and LogoutResponse messages.

āœ“ Do: Implement SAML SLO by registering your SP's SLO endpoint in its metadata, handling incoming IdP-initiated LogoutRequest messages by immediately invalidating the local session, and propagating SP-initiated logout to the IdP's SLO URL when users click 'Sign Out'.
āœ— Don't: Do not rely solely on session timeouts as a substitute for SLO implementation, and do not ignore incoming SAML LogoutRequest messages from the IdP by returning an error or no response.

How Docsie Helps with SAML 2.0

Build Better Documentation with Docsie

Join thousands of teams creating outstanding documentation

Start Free Trial