Delinea Blog > The difference between SAML and OIDC

The difference between SAML and OIDC

Published August 2022
Read time 7 minutes
What you will learn
SAML and OIDC both enable single sign-on, but they use different formats and suit different applications. SAML uses signed XML assertions and is common in enterprise web single sign-on. OIDC uses JSON Web Tokens on top of OAuth 2.0 and is common for mobile, single-page and API-driven applications. 

Security Assertion Markup Language (SAML) and OpenID Connect (OIDC) both let users sign in once and reach many applications. So which one should you use?  It depends on the applications you need to connect, and many organizations end up running both. Here's how the two protocols compare and how to choose between them. 

What are SAML and OIDC?

SAML and OIDC are two identity protocols that allow an identity provider to authenticate users and share information about them with applications, allowing users to sign in once and access many applications. SAML is most commonly used by businesses for workforce single sign-on to enterprise and web applications, whereas OIDC is a good fit for mobile, single-page and API-driven applications.

An identity provider (IdP) can implement either protocol as the basis for user identity management, and many support both. An IdP is a trusted third party that authenticates users and provides them with a single set of credentials they can use to access multiple applications. Users don't have to remember multiple username and password combinations, and organizations can more easily manage security and control access to their systems.

Security Assertion Markup Language (SAML)

SAML (SAML 2.0 since 2005) is an authentication and authorization standard. Authentication verifies that users are who they claim to be, while authorization allows authenticated parties to perform the actions they request. SAML is an XML-based protocol for exchanging security information online. Because SAML enables single sign-on (SSO), a user can authenticate once and then access multiple applications without having to re-enter credentials 

SAML exchanges take place between an asserting party (also called a SAML authority) and a relying party that processes the security assertions it receives. In practice, the asserting party is the IdP and the relying party is the service provider (SP). Security assertions are standardized statements in XML that carry authentication and attribute information, which the SP uses to make access control decisions. 

OpenID Connect (OIDC)

OpenID Connect (OIDC) is an authentication layer built on top of the OAuth 2.0 authorization framework. OIDC allows applications, known as relying parties, to verify an end user's identity and obtain basic profile information from an IdP. It works with a wide range of applications, from web apps and single-page applications (SPAs) to native and mobile apps. Like SAML, OIDC may also be used to provide SSO across apps.

How SAML and OIDC differ

The main differences between SAML and OIDC are their formats and designs. SAML exchanges signed XML assertions and was built for browser-based enterprise SSO. OIDC is built on OAuth 2.0 and exchanges signed JSON Web Tokens (JWTs), which suits mobile, single-page and API-driven applications.

SAML is an older standard and is widely adopted in enterprises that use web-based applications, while OIDC is newer and widely used for mobile, native and API-driven applications. 

Enterprises that adopt SAML need a SAML-capable IdP to authenticate users. When a user requests access, the SP redirects the user to the IdP, the IdP authenticates the user and returns a signed assertion to the SP, and the SP grants access. A single set of login credentials can then reach multiple web applications. 

With OIDC, the IdP can be a public service such as Microsoft or Google or an enterprise provider, such as Okta, Microsoft Entra ID or Ping Identity. A user can gain access to an application by signing in with a trusted, OIDC-compatible accounts.

SAML is more complex than OIDC, which can make it harder to implement. SAML uses verbose XML to exchange data, which creates heavier data handling loads. OIDC is generally simpler to implement because it uses JSON and relies on Transport Layer Security (TLS), which is already built into clients and servers. It's also easy to reach through application programming interfaces (APIs). Because OIDC uses compact, signed JWTs, it is a lighter-weight option that can perform better. 

Similarities between SAML and OIDC

SAML and OIDC are similar in that they are both authentication protocols that provide users with an SSO experience. Both are widely used and can be configured to improve user privacy by controlling which user attributes (called claims in OIDC) are shared. Their security depends on how they are implemented and configured. In addition, both rely on an IdP to authenticate users.

SAML and OIDC security considerations

Neither SAML nor OIDC stops brute force or phishing attacks on its own. The IdP and its configuration do most of the work. Here's how the two protocols compare on three security topics: brute force attack prevention, phishing attack prevention and privacy protection.

Brute force attack prevention

A brute force attack is a method cyber criminals use to crack passwords, encryption keys and other login credentials through trial and error. Blocking attempts to guess passwords or other authentication credentials is a critical security control that can stop this unauthorized access to systems and data. 

SAML

SAML doesn't block guessing attempts itself. Because users authenticate at the IdP, the IdP can apply account lockout, rate limiting and multi-factor authentication (MFA) in one place. 

OIDC

The same is true of OIDC. The IdP handles authentication, so it can apply lockout, rate limiting and MFA, and the application never handles the user's password.

Phishing attack prevention

A phishing attack is a way for cyber criminals to steal user data, including login credentials, encryption details and even credit card numbers. In a phishing attack, the cyber criminal impersonates a known entity to win trust and gain access to sensitive information. A common example is a spoofed email from a bank warning that the user's account will be locked unless the user provides information to prove their identity. The cyber criminal then uses this information to gain access to the user's bank account. For organizations, preventing phishing attacks helps protect sensitive data, finances and reputation. 

SAML 

SAML assertions are signed and carry the user's identity, the application they're meant for and a validity period, so an SP can reject assertions that are forged, altered or expired. SAML doesn't stop a user from being phished at the IdP's login page, so phishing-resistant MFA at the IdP matters. 

OIDC

With OIDC, users sign in at the IdP and don't need a separate password for each application, which reduces the number of credentials a cyber criminal can target. OIDC doesn't stop phishing of the IdP's login page either, so phishing-resistant MFA at the IdP matters.

Privacy protection

Privacy protection is an overall approach to keeping your information from getting into the wrong hands. Examples include protecting personal data, stopping unwanted solicitations and protecting email addresses.

SAML

SAML lets the IdP release only the attributes an SP needs, and organizations can configure which attributes are sent to each application. The IdP and the applications handle deleting or exporting a user's data, not SAML itself.

OIDC

OIDC lets an application request only the claims it needs, such as name and email address, through scopes. The IdP can show the user what will be shared and ask for consent, so applications don't receive details such as birthdate or home address unless they request it and the user or administrator allows it. 

How to choose between SAML and OIDC

OIDC and SAML are both established authentication protocols, each with its own strengths. Here are some factors to weigh when deciding which one fits your organization best

Choose OIDC if:

  • fast and easy implementation is your top priority. 
  • you use an API-centered architecture with native or single-page applications.
  • you want a lightweight protocol that tends to perform better.

Choose SAML if:

  • your enterprise or legacy web applications support only SAML.
  • you need a mature standard with a long track record in enterprise SSO.

Both support MFA through IdP, so security alone is rarely the deciding factor. Many organizations run on both, using SAML for existing enterprise applications and OIDC for newer applications and APIs.

Frequently asked questions about SAML and OIDC

Can OIDC replace SAML?

In many cases, yes. OIDC can handle the same SSO use cases and is simpler to implement. It also has security profiles for high-assurance sectors, such as the Financial-grade API (FAPI) profile for financial services. But many enterprises still support only SAML, so many organizations run on both.

Is SAML still widely used?

Yes. SAML won't be phased out anytime soon, especially for enterprise applications. OIDC is gaining ground for newer applications and the two commonly coexist. Whether OIDC eventually becomes the dominant standard is an open question.

Is OIDC still widely used?

Yes. Major IdPs support it, and newer authentication methods such as passkeys don't replace OIDC; they work with it, because the IdP can use a passkey to authenticate the user and still issue OIDC tokens. Extensions such as the FAPI profile and Client-Initiated Backchannel Authentication (CIBA) build on OIDC. 

How the Delinea Platform works with SAML and OIDC

SAML and OIDC are established standards that each support SSO. SAMl is a mature standard that many enterprise applications rely on, and OIDC is a lightweight option for mobile, single-page and API-driven applications. 

The Delinea Platform supports both. Users sign in with the IdP they already use via SAML or OIDC, and the platform integrates with providers such as AD FS, Okta, Microsoft Entra ID, Google, Ping Identity, and OneLogin. Users authenticate at the IdP, and the platform validates the response before granting access. You can configure multiple IdPs, and if your users start at an IdP portal, the platform supports that flow via SAML. 

Is SAML or OIDC right for your business?

The right authentication standard depends on your organization's needs, including the level of protection required, your daily login traffic and the types of applications you need to secure.

By understanding the differences between SAML and OIDC and which one best fits your organization, you can strengthen user and application authentication while keeping workflows and costs in mind. 

See how the Delinea Platform works with your IdP. Schedule a demo.

Related Topics