SAML vs OIDC vs OAuth: Which One Do You Need?
SAML and OIDC sign users in, OAuth gives apps access to APIs. How each works, how they differ, and which one your product needs.
Leonard HuΓkeβ’β’9 min read

On this page
SAML and OpenID Connect (OIDC) sign users in. OAuth 2.0 lets an app call an API. If you are adding login to your own app, use OIDC. If you sell to companies, their IT teams often want employees to sign in through Okta, Entra ID, or Google Workspace. Many of those teams ask for SAML, so support it as well. If other apps, AI agents, or your own services call your API, use OAuth.
- SAML 2.0 dates from 2005. It passes XML assertions through the browser and is the standard for enterprise single sign-on.
- OpenID Connect dates from 2014. It adds an identity layer on top of OAuth 2.0 and returns an ID token, a JWT that says who signed in. It is the default for new apps.
- OAuth 2.0 dates from 2012. It handles authorization, not authentication, and returns an access token that says what an app may do.
- 33 of the 37 providers in our directory support SAML. 18 support SCIM, which B2B customers usually ask for at the same time.
SAML and OIDC handle authentication, OAuth handles authorization
People compare the three because all three appear on the same login screens. They answer different questions.
- Authentication asks who the user is. SAML and OIDC answer that question.
- Authorization asks what an app may do. OAuth answers that question.
The OAuth community's article on user authentication with OAuth 2.0 says that "OAuth 2.0 is not an authentication protocol". OAuth gives an app a token to call an API. The token says nothing reliable about who the user is. OpenID Connect adds what is missing, and its spec calls it "a simple identity layer on top of the OAuth 2.0 protocol".
The real comparison is SAML vs OIDC for signing users in. OIDC is built on OAuth, and OAuth controls access to APIs.

SAML vs OIDC vs OAuth compared
| SAML 2.0 | OpenID Connect | OAuth 2.0 | |
|---|---|---|---|
| Answers | Who is this user? | Who is this user? | What may this app do? |
| Published | March 2005, OASIS | February 2014, OpenID Foundation | October 2012, RFC 6749 |
| Token | XML assertion, signed with XML Signature | ID token in JWT format, plus an access token | Access token in a format the spec leaves open |
| Data format | XML | JSON | JSON |
| Transport | Browser redirects and form posts | Browser redirects, then a back-channel call | Browser redirects, then a back-channel call |
| Works for mobile apps and single-page apps | Poorly | Yes, with PKCE | Yes, with PKCE |
| Works for APIs and machines | No | No, OAuth handles that | Yes |
| Typical use | Employees who sign in to SaaS through their company IdP | Login for your app, social login, and modern enterprise SSO | Third-party API access, AI agents, and calls between services |
How SAML works
SAML 2.0 is an OASIS standard approved in March 2005. Its core is the assertion, which the spec defines as "a package of information that supplies zero or more statements made by a SAML authority". In practice, the identity provider (IdP) tells your app who the user is and adds attributes such as email, name, and groups. SAML calls your app the service provider (SP).
The most common flow starts at your app. OASIS calls this flow "SP-initiated web SSO". SAML also supports IdP-initiated sign-in, where the user starts from a dashboard of apps.

Three details matter when you build or buy SAML support:
- The browser carries every message. The request usually travels in a redirect, which SAML calls the HTTP-Redirect binding. The response is a base64-encoded HTML form. The browser posts that form to your Assertion Consumer Service (ACS) URL, and SAML calls that step the HTTP-POST binding.
- All of the security rests on the signature. With the POST binding, the assertion "MUST be signed". Before your app trusts anything in the assertion, it must check the signature, the issuer, the audience, and the time window.
- XML signature checks are easy to get wrong. A 2012 USENIX Security study of 14 major SAML frameworks found that 11 had critical XML Signature wrapping flaws. Anyone who holds the IdP's signing key can also create assertions for any user, an attack called "Golden SAML". Use a maintained library or an auth provider instead of parsing SAML yourself.
The SAML standard is finished. The OASIS technical committee that wrote it closed in July 2023. Enterprises still use SAML widely, because many of their identity providers and admins already have it set up.
How OpenID Connect works
The OpenID Foundation finalized OpenID Connect Core 1.0 in February 2014. The current text includes errata set 2 from December 2023. In 2024, ISO/IEC published OpenID Connect Core and eight related specs as ISO/IEC 26131 to 26139.
OIDC uses the OAuth 2.0 authorization code flow and adds an ID token. The spec defines the ID token as "a security token that contains Claims about the Authentication of an End-User", in the form of a JSON Web Token (JWT). Every ID token must carry the issuer (iss), the user's identifier (sub), the audience (aud), an expiry time (exp), and the time it was issued (iat).

Four things make OIDC easier to work with than SAML.
- Tokens stay out of the redirects. The code flow "returns an Authorization Code to the Client, which can then exchange it for an ID Token and an Access Token directly". The redirect carries only the code, so the tokens never appear in a URL.
- OIDC uses JSON and JWTs instead of XML. Every language has a JWT library, and your app checks one signature on a compact token.
- Clients can discover the configuration. A provider publishes its endpoints and keys at
/.well-known/openid-configuration. An enterprise connection often needs only an issuer URL, a client ID, and a secret. - OIDC works for mobile apps and single-page apps. With PKCE, a public client, which cannot keep a secret, can still use the code flow.
"Sign in with Google" uses OIDC. Google says that its OAuth 2.0 implementation for authentication "conforms to the OpenID Connect specification, and is OpenID Certified".
How OAuth 2.0 works
RFC 6749 defines OAuth 2.0 as a framework that "enables a third-party application to obtain limited access to an HTTP service", either for a user or for itself. The result is an access token, usually sent as a bearer token. The bearer token spec warns that "any party in possession of a bearer token" can use it.
These are the grants to use in 2026:
| Grant | Use it for | Status |
|---|---|---|
| Authorization code with PKCE | Web, mobile, and single-page apps that act for a user, third-party integrations, AI agents, and MCP clients | Recommended. "Public clients MUST use PKCE" |
| Client credentials | Backend services and jobs that call an API with no user present | Current |
| Device authorization | TVs, CLIs, and devices without a browser or keyboard | Current |
| Implicit | Nothing new | "SHOULD NOT" be used. Removed in OAuth 2.1 |
| Resource owner password | Nothing | "MUST NOT be used". Removed in OAuth 2.1 |
The statuses come from RFC 9700, the IETF's current security advice for OAuth 2.0.
OAuth 2.1 collects these rules into one document. It is still an IETF draft. Version 17 came out in October 2026, and the working group plans to send it to the IESG, the group that approves IETF standards, in December 2026. OAuth 2.1 requires PKCE for the authorization code grant, drops the implicit and password grants, requires exact redirect URI matching, and forbids bearer tokens in query strings. If your provider already follows RFC 9700, little changes for you.
SAML vs OIDC for enterprise SSO: support both
Most B2B teams face this choice. Microsoft's decision guide puts it this way: "OIDC suits new, cloud-native SaaS and customers with modern identity, while SAML is a requirement-driven choice for enterprise customers, compliance or procurement mandates, or legacy identity providers that support only SAML". Its advice is "If unsure, default to OIDC for new SaaS development".
The large identity providers support both protocols. The Microsoft Entra app gallery has separate SAML and OIDC tracks for listed apps. Okta supports OAuth 2.0 and OIDC as well as SAML 2.0 app integrations. Google Workspace lets admins add custom SAML apps.
Your customer's IT team makes the decision. If that team accepts only SAML, you need SAML to win the customer. In a 2025 Okta survey of 1,000 enterprises, 96% of technology buyers put identity and access requirements in their requests for proposals (RFPs) for SaaS. In practice, that means three steps:
- Build your own login on OIDC, even before you have enterprise customers.
- Offer SAML and OIDC enterprise connections for each customer organization once you sell to companies. Don't build SAML yourself. Every provider below handles the XML, the certificates, and the metadata.
- Add SCIM when customers ask for automatic provisioning and deprovisioning. SCIM 2.0 is a separate protocol that manages user accounts across domains. SSO signs users in, and SCIM creates and removes their accounts.
Most auth providers support SAML, half support SCIM
Our directory tracks 55 features across 37 auth providers. The chart shows how many providers support each protocol feature from this post.
Protocol support across 37 auth providers
Number of providers in the Auth0Alternatives directory that support each feature, November 2026
- Enterprise SSO34
- SAML33
- Access tokens32
- M2M tokens28
- MCP auth24
- SCIM18
- Device login18
- LDAP13
Source: Auth0Alternatives listings
Show data
| Providers (of 37) | |
|---|---|
| Enterprise SSO | 34 |
| SAML | 33 |
| Access tokens | 32 |
| M2M tokens | 28 |
| MCP auth | 24 |
| SCIM | 18 |
| Device login | 18 |
| LDAP | 13 |
"M2M tokens" means the OAuth client credentials grant. Almost every provider supports SAML. SCIM separates them, and only 18 of the 37 providers support it. If your customers are enterprises, check for SCIM first. The feature pages for SAML and SCIM list every provider.
The table shows a selection of providers with SAML support, from our listings.
| Provider | SAML | SCIM | LDAP | Open source | Self-hosted |
|---|---|---|---|---|---|
| Auth0 | Yes | Yes | Yes | No | No |
| WorkOS | Yes | Yes | No | No | No |
| Descope | Yes | Yes | Yes | No | No |
| Scalekit | Yes | Yes | No | No | No |
| Stytch | Yes | Yes | No | No | No |
| Frontegg | Yes | Yes | No | No | No |
| FusionAuth | Yes | Yes | Yes | No | Yes |
| Zitadel | Yes | Yes | Yes | Yes | Yes |
| Ory | Yes | Yes | Yes | Yes | Yes |
| authentik | Yes | Yes | Yes | Yes | Yes |
| Better Auth | Yes | Yes | No | Yes | Yes |
| Keycloak | Yes | No | Yes | Yes | Yes |
| Clerk | Yes | No | No | No | No |
| Amazon Cognito | Yes | No | No | No | No |
To compare two providers side by side, see WorkOS vs Auth0 or Keycloak vs Zitadel.
Pick the protocol by what you build
| You are building | Use |
|---|---|
| Login for your own web or mobile app | OIDC through an auth provider |
| Sign-in with Google, Microsoft, or GitHub | OIDC, or OAuth 2.0 where a provider has no OIDC |
| SSO for employees of your business customers | SAML and OIDC enterprise connections |
| Automatic user provisioning for those customers | SCIM 2.0 |
| A public API that other apps call for a user | OAuth 2.0, authorization code with PKCE |
| An MCP server or tools for AI agents | OAuth 2.0, see providers with MCP authorization |
| Calls between your own services | OAuth 2.0 client credentials |
| Login on a TV or in a CLI | OAuth 2.0 device authorization |
To compare vendors, start with Auth0 vs Okta. It explains which of the two products is for your customers and which is for your employees.
FAQ
No. OpenID Connect replaced the older OpenID 2.0. The OpenID Foundation says the two "solve a very similar set of problems". OpenID 2.0 "used XML and a custom message signature scheme", and OIDC uses OAuth 2.0 and JSON. Today, "OpenID" almost always means OIDC.
Yes. Many products use both. A typical B2B app signs employees in with SAML, then issues its own OAuth access tokens for its API. The two protocols solve different problems, so they don't conflict.
Neither is more secure by design. Both rely on signed tokens that your app checks. SAML's XML signatures have a long history of implementation bugs. OIDC inherits OAuth's pitfalls, and RFC 9700 lists those pitfalls in detail. The secure choice is a well-maintained implementation, not a particular protocol.
Both. Okta supports OAuth 2.0 and OIDC and lets admins create SAML 2.0 app integrations. Auth0, also owned by Okta, lists OAuth 2.0, OIDC, SAML, WS-Federation, LDAP, and SCIM among the standards it uses.
"Sign in with Google" uses OpenID Connect. Google Workspace can also act as a SAML identity provider for company apps.
Not yet. In November 2026, OAuth 2.1 is at draft 17, and the working group plans to submit it to the IESG in December 2026. Most of its rules already apply through RFC 9700.
Only if your customers ask for it. Consumer apps and self-serve B2B products usually don't need SAML. Once you sell to larger companies, expect some IT teams to require it. Pick an auth provider that offers both.
On this page