Real-world examples of diverse examples of SAML authentication in modern APIs
The best examples of diverse examples of SAML authentication almost always start with single sign-on (SSO) in large enterprises. Picture a company with thousands of employees, dozens of SaaS tools, and a mix of old on‑prem apps and shiny new cloud platforms. Nobody wants separate logins for each.
So the company rolls out an identity provider (IdP) like Okta, Azure AD, or PingFederate. Every major SaaS app—Salesforce, ServiceNow, Workday—acts as a service provider (SP) that trusts SAML assertions from that IdP.
Here’s how a typical SAML SSO flow for a web app looks in practice:
- A user clicks “Login with Corporate SSO” on the SaaS app.
- The app redirects the browser to the IdP’s SAML endpoint with an AuthnRequest.
- The IdP authenticates the user (password, MFA, maybe FIDO2 key).
- The IdP posts a signed SAML assertion back to the app.
- The app validates the signature, extracts attributes like
NameID, email, group membership, and then issues its own session or API token.
This is the example of SAML authentication most engineers first encounter. It’s not just human login to a web UI; the SAML assertion often drives API access as well. The app might translate SAML attributes into internal roles that control which API endpoints the user can hit.
API gateways and SAML: When legacy meets modern microservices
Another set of real examples of diverse examples of SAML authentication shows up at the API gateway layer. Many organizations still use SAML for user-facing SSO but want to expose modern REST or GraphQL APIs behind that identity layer.
A common pattern looks like this:
- A user signs in to a web app via SAML SSO.
- The app or gateway validates the SAML assertion.
- The gateway then issues a short‑lived JWT or opaque access token for backend APIs.
In this scenario, the SAML assertion itself rarely travels to the microservices. Instead, it’s used once at the edge to bootstrap a more API‑friendly token. This hybrid pattern is one of the best examples of SAML authentication being used as a bridge between older enterprise identity infrastructure and modern API security practices.
Vendors like Kong, Apigee, and AWS API Gateway support this pattern either directly or via plugins and Lambda authorizers. You’ll see it often in large companies that adopted SAML long before OAuth 2.0 and OpenID Connect became mainstream.
Healthcare: SAML in EHR portals and patient APIs
Healthcare systems in the US and abroad are textbook examples of diverse examples of SAML authentication in sensitive environments.
Electronic Health Record (EHR) vendors and hospital portals often use SAML-based SSO to:
- Let clinicians sign in once to access EHR, lab results, and scheduling tools.
- Federate identities across partner organizations (for example, a regional health network).
- Control access to FHIR APIs that expose patient data.
You might see a clinician log in to a hospital portal via SAML, and then that portal calls FHIR APIs using tokens mapped from SAML attributes like roles (physician, nurse, admin).
While FHIR itself typically uses OAuth 2.0 and OpenID Connect for direct API access, the front-end identity story in many deployments is still SAML-heavy. If you want to understand how SAML fits into regulated ecosystems, the healthcare space offers some of the best examples of SAML authentication in the wild.
For background on FHIR and healthcare APIs, the Office of the National Coordinator for Health Information Technology (ONC) provides helpful resources: https://www.healthit.gov/topic/federal-health-it-strategy-and-programs/fast-healthcare-interoperability-resources-fhir
Higher education: Campus-wide SSO and research federation
Universities are famous for their federation stories, and they offer rich examples of diverse examples of SAML authentication across institutions.
Many universities join federations like InCommon in the US or eduGAIN internationally. A student or researcher from one university can use their home institution’s credentials to access services at another.
Here’s a typical example of SAML authentication in higher ed:
- A researcher at University A wants access to a computing cluster hosted by University B.
- University B’s portal is a SAML SP; it redirects the researcher to their home IdP at University A.
- University A authenticates the user and sends a SAML assertion back to University B.
- The assertion includes attributes like affiliation (
faculty,student), which University B uses to grant or restrict access.
If you want real examples and technical documentation, InCommon (operated by Internet2) publishes guidance and profiles for SAML federation: https://www.incommon.org/federation/tech-docs.html
These academic environments highlight why SAML is still widely used in 2024–2025 for cross‑organization trust, especially when browser-based SSO is the main interaction pattern.
Government portals: Citizen services and cross-agency access
Government portals around the world provide more examples of diverse examples of SAML authentication, especially where citizens or employees need to access multiple agencies with one account.
A common pattern:
- A national or state identity provider handles authentication (for example, a government login portal).
- Individual agency systems (tax, benefits, licensing) act as SAML service providers.
- SAML assertions carry identifiers and attributes that agencies use to personalize and authorize access.
US federal systems have gradually moved toward more modern standards like OpenID Connect, but SAML is still widely referenced in identity guidance and legacy systems. For example, the NIST Digital Identity Guidelines discuss federation concepts that apply to SAML and related protocols: https://pages.nist.gov/800-63-3/
These government use cases show how SAML supports long-lived, inter-agency trust relationships where change happens slowly and backward compatibility matters.
B2B SaaS integrations: Partner access and delegated administration
If you run a B2B SaaS platform, you’ve probably had customers demand SAML SSO. Those customer stories are some of the most practical examples of diverse examples of SAML authentication in API-centric businesses.
Imagine a SaaS analytics platform used by dozens of large enterprises. Each customer wants:
- Their employees to log in with the company IdP.
- Automatic provisioning of users and roles based on SAML attributes.
- Clear audit trails that tie API activity back to corporate identities.
The SaaS app becomes a SAML SP, while each customer’s IdP (Okta, Azure AD, ADFS, etc.) issues assertions. The app might:
- Map SAML groups to internal roles (for example,
AnalyticsAdmin,Viewer). - Use SAML attributes to drive feature flags or data access scopes.
- Issue its own API tokens tied to the SAML identity for automation workflows.
These B2B SaaS deployments are often the best examples of SAML authentication interacting directly with API design: everything from rate limits to data partitioning can be keyed off the identity established by SAML.
Internal legacy apps: Wrapping old systems with SAML-aware proxies
Not every app was born in the age of SAML. Many organizations still run legacy internal systems that know nothing about modern SSO. Yet those systems often become part of larger SAML-based SSO ecosystems.
One common example of SAML authentication in legacy environments is the use of a reverse proxy or access gateway:
- The gateway is configured as a SAML SP.
- Users authenticate to the IdP via SAML.
- After validation, the gateway injects headers or cookies that the legacy app understands (for example,
X-User-Id,X-User-Roles).
From the app’s perspective, it still sees a simple header-based or cookie-based authentication scheme. From the user’s perspective, it’s part of the same SAML SSO experience as the rest of the environment.
This pattern is especially common in finance and manufacturing, where line‑of‑business apps may be 10–20 years old but still need to sit behind a modern identity perimeter.
Comparing SAML to OAuth 2.0 and OpenID Connect in 2024–2025
Any honest discussion of examples of diverse examples of SAML authentication in 2024–2025 has to acknowledge the competition. SAML is no longer the shiny new thing; OAuth 2.0 and OpenID Connect (OIDC) dominate greenfield API projects.
In practice, here’s how they tend to split:
- SAML is common for browser-based SSO into enterprise and government apps.
- OIDC is preferred for modern web and mobile login flows.
- OAuth 2.0 is the go‑to for API authorization, especially for machine-to-machine access.
Modern architectures often mix them. You might see:
- SAML between corporate IdP and SaaS app for employee SSO.
- OIDC between that SaaS app and its own mobile clients.
- OAuth 2.0 access tokens for the SaaS app’s public APIs.
SAML isn’t disappearing, but its center of gravity is clearly enterprise SSO and federation. The best examples of SAML authentication today are about bridging organizations and wrapping older systems, not powering the latest mobile app.
Design tips drawn from real examples of SAML authentication
Looking across these examples of diverse examples of SAML authentication, some consistent design lessons show up:
Use SAML at the edges, not deep inside APIs.
Most modern systems treat SAML as a browser-facing protocol. They convert SAML assertions into API-friendly tokens (JWTs, opaque tokens) at the gateway or app boundary.
Be explicit about attribute mapping.
Real examples of SAML authentication go wrong when teams hand-wave attribute mapping. Document which SAML attributes map to roles, tenants, and scopes. Version those mappings like you would an API.
Plan for multi-IdP scenarios.
B2B SaaS and education federations often juggle dozens or hundreds of IdPs. Normalize attributes, support metadata automation where possible, and monitor certificate expiration across all IdPs.
Monitor and log the SAML layer.
Because SAML often sits at the front door, failures there look like “the whole app is down.” Log assertion validation errors, clock skew problems, and signature issues in a way your ops team can actually act on.
For security best practices and terminology that apply across these protocols, the NIST identity guidelines are still a solid reference point: https://pages.nist.gov/800-63-3/sp800-63b.html
FAQ: Common questions about SAML and real-world examples
What are some common examples of SAML authentication in modern systems?
Common examples include enterprise SSO into SaaS tools, campus federation in higher education, cross‑agency government portals, healthcare clinician portals, and B2B SaaS customer SSO. In many of these, SAML is used for browser-based login, and then the app or gateway issues separate tokens for APIs.
Can you give an example of SAML being used with APIs, not just web logins?
A frequent example of SAML with APIs is an API gateway that accepts SAML assertions from a corporate IdP, validates them, and then issues short‑lived JWTs for internal microservices. The microservices never see SAML directly; they just trust the gateway’s tokens, while the user identity ultimately comes from the SAML assertion.
Are there still good reasons to choose SAML over OpenID Connect in 2025?
Yes, especially if you’re integrating with existing enterprise IdPs, joining academic or government federations, or supporting customers whose security teams standardize on SAML. For greenfield mobile or SPA projects, OpenID Connect is usually a better fit, but SAML remains very common in enterprise SSO deals.
How do real examples of SAML authentication handle mobile apps?
Most mobile apps avoid handling SAML directly. Instead, they use system browsers or app-to-browser SSO flows to complete SAML login, then exchange the resulting session or cookies for OAuth/OIDC tokens via a backend. This keeps SAML in the browser world while giving mobile clients modern tokens.
What are typical pitfalls when implementing these examples of SAML authentication?
Common issues include certificate rollover failures, clock skew between IdP and SP, mismatched entity IDs or ACS URLs, and poorly defined attribute mappings. Many “it works for some users but not others” bugs come down to inconsistent attributes across identity stores.
If you keep these patterns in mind and study real examples of diverse examples of SAML authentication—from healthcare portals to B2B SaaS—you’ll be in a much better position to design SSO flows that play nicely with both legacy systems and modern APIs.
Related Topics
Real-world examples of examples of session-based authentication example in modern APIs
Real-world examples of examples of OAuth 2.0 authentication example in modern APIs
Real-world examples of OpenID Connect authentication example patterns
Real-world examples of examples of basic authentication API example
Real-world examples of digest authentication in modern APIs
Real-world examples of diverse JWT authentication methods developers actually use
Explore More Authentication Methods in APIs
Discover more examples and insights in this category.
View All Authentication Methods in APIs