Delinea Blog > The difference between SAML and LDAP

The difference between SAML and LDAP

Published August 2022
Read time 6 minutes
What you will learn
SAMl and LDAP do different jobs. SAML carries the result of a sign-in form an IdP to a web application, usually for SSO. LDAP lets applications and servers query a directory and verify credentials against it. 

Security Assertion Markup Language (SAML) and Lightweight Directory Access Protocol (LDAP) often get compared as if you have to pick one. You usually don't. Many organizations use both: an identity provider (IdP) checks a user's credentials against an LDAP directory, then sends the application a SAML assertion. Here's how the two differ, where each fits and how they work together in secure user authentication.

What are SAML and LDAP?

SAML and LDAP are two distinct standards that both play a role in user authentication. SAML allows an IdP to tell an application that a user has signed in. LDAP is a protocol for querying and updating a directory service, such as Active Directory (AD), and for verifying credentials against it. That's why the two often work together: LDAP stores and verifies credentials, and SAML carries the sign-in result to the application.

Security Assertion Markup Language (SAML)

SAML is an open-standard protocol for passing information between a user, an IdP and an application. It's most often used for web single sign-on (SSO), for cloud and on-premise web applications alike. Some VPN products also accept SAML sign-in.

SAML simplifies the authentication process by exchanging information between an IdP and a service provider (SP), such as a web application. In the setup, a user requests a service from an SP, which must then request authentication from the IdP. SAML streamlines this communication process by requiring users to log in only once with a single set of credentials. When the same protocol is used to access multiple services with a single login, SAML can enable SSO.

Lightweight Directory Access Protocol (LDAP)

LDAP is an open-standard, vendor-neutral application protocol for querying and modifying data in a directory service, such as AD. Applications, servers and devices use an LDAP client, usually built into the software, to connect to the directory over Transmission Control/Internet Protocol (TCP/IP) and look up information about users, groups and resources. LDAP can also verify a user's credentials against the directory through a bind request, ideally over Transport Layer Security (TLS). 

When an application or server receives a request from a user, it can use LDAP to check whether the credentials match the information stored in the directory. If the directory contains group or permission data, LDAP can also indicate whether the user is allowed to use the resource. 

How SAML and LDAP differ

The difference between SAML and LDAP lies in the job each performs. SAML is a web SSO standard: it carries a signed Extensible Markup Language (XML) assertion from an IdP to an SP, allowing a user to sign in once. LDAP is a directory protocol: applications and servers use it to look up users and groups and to verify credentials against a directory, which is usually on-premise. 

What SAML and LDAP have in common

The main similarity between SAML and LDAP is their purpose: to allow users to access a network of organizational resources through secure authentication. Both carry or store information applications use to make authorization decisions. In other words, they help verify, add or reject users, but they don't track user activity. 

LDAP doesn't provide SSO on its own. It gives you a central place to store credentials, so users can use a single set across applications, while each application still asks for them. SAML enables true SSO, because the user signs in once at the IdP.

SAML and LDAP advantages and disadvantages

Each protocol has trade-offs worth weighing before you decide where it fits.

SAML advantages and disadvantages

Advantages:

  • Better user experience. Users sign in once with a single set of credentials to access multiple SPs. 

  • Lower IT maintenance and costs. Fewer password resets and other IT tasks save time and money.

  • Centralized security controls. Credentials are stored with the IdP, which can apply up-to-date security controls such as multi-factor authentication (MFA) and conditional access.

Disadvantages:

  • Reliance on the IdP. The IdP manages credentials and starts the authentication process, so organizations depend on its availability and security controls.

  • Development effort. Sharing data in XML takes more development effort than simpler token formats, though mature libraries exist.

  • Awkward for native mobile apps. SAML is built around the browser, so it can be awkward for native mobile applications. 

LDAP advantages and disadvantages

Advantages:

  • Centralized information. LDAP serves as a central hub for authentication, consolidating resources into a directory that applications can query. 
  • System flexibility. LDAP works with many operating systems, directory services, devices and applications. As an open standard, it gives developers ample room to configure it to their needs.
  • Secure transmissions. LDAP can use TLS, which encrypts data in transit across the network.

Disadvantages:

  • Complex setup and maintenance. As an older standard that uses its own ports, LDAP can take significant expertise, equipment and cost to deploy and manage. 
  • Scaling takes planning. Directory servers scale through replication and careful design, but expanding storage or user capacity, especially across sites, requires planning and can add cost and development effort. 

Common use cases for SAML and LDAP

SAML and LDAP are primarily used to help authorize users' access to an organization's resources and securely verify that each user is who they say they are. SAML lets an IdP tell applications who has signed in, which enables SSO for web applications.

LDAP acts as the identity store for many organizations, storing and verifying credentials in the network. Applications and devices use that directory information to decide what a user can retrieve or use, from software applications to specific devices like printers. 

Common use cases include:

  • Secure access management. Users reach the data, applications, devices and files they need for their work, on-premise or in the cloud. 

  • User verification. Applications verify users' identities before granting system access. 

  • Multi-system connectivity. Applications and servers look up users and groups in a central directory (LDAP) and receive sign-in results from an IdP (SAML).

  • SSO support. SAML enables SSO for web applications. LDAP provides a central credential store that SSO solutions can build on.

How to choose between SAML and LDAP

SAML and LDAP aren't an either-or choice. Each fits a different job, and the one you use usually depends on the application. 

 Use SAML when:

  • your business or internal applications are web or cloud applications your IdP can sign users in to. 

  • your team is lean and doesn't have the people, resources or expertise to build an elaborate architecture, since the IdP does most of the work.

Use LDAP when:

  • applications, servers or devices need to look up users and verify credentials against an on-premise directory, which is what LDAP was built for. 

  • you need room to customize, since LDAP is an open standard that works with many applications and systems.

Frequently asked questions about SAML and LDAP

Does LDAP support SAML?

Not directly. SAML sends assertion data between an IdP and an SP to indicate that a user has signed in. LDAP is a protocol for querying a directory and verifying credentials. An IdP can use an LDAP directory, such as AD, as its source of user and credential information, and then send SAML assertions to applications. The LDAP directory itself doesn't act as the SAML IdP.

What is the difference between SSO and LDAP?

SSO is a convenient authentication experience that lets users access multiple applications and systems with just one login. LDAP is the protocol that applications and servers use to query a directory service. LDAP provides a central credential store, so users can use a single set of credentials across applications, but each application still asks for them. To get true SSO, you add a protocol such as SAML, OpenID Connect or Kerberos on top of the directory.  

What is the difference between SSO and SAML?

SSO is the experience of signing in once to reach multiple applications. SAML is one of the protocols that makes SSO possible, specifically for web and cloud applications, by carrying a signed assertion from the IdP to each application. Other protocols, such as OIDC and Kerberos, can provide SSO, too.

How the Delinea Platform works with SAML and LDAP

The Delinea Platform works with both. Users can sign in through any standards-compliant SAML 2.0 or OIDC IdP, including Okta and Microsoft Entra ID. If your users are in on-premise AD, the AD Connector syncs users and groups to the platform and supports AD-based authentication.

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

Related Topics