liveBook · Manning

Lightweight Directory Access Protocol

As explained in Data Pipelines with Apache Airflow, Second Edition

An LDAP service is a directory service that supports queries through the Lightweight Directory Access Protocol.

Lightweight Directory Access Protocol (LDAP) is a protocol for querying directory services such as Microsoft Entra ID or OpenLDAP. Directory services centrally store information about users and other resources, allowing applications such as Airflow to verify credentials without maintaining separate user accounts. section 16.3 section 16.3.1

LDAP is suited to directory workloads dominated by frequent reads and relatively infrequent changes. Data is organized as a directory information tree (DIT); each entry contains attribute-value pairs and has a unique distinguished name (DN). Common structure uses domain components (dc), organizational units (ou), and common names (cn). section 16.3.1

Core LDAP operations include:

  • Bind authenticates as a user after the initial anonymous connection. section 16.3.1
  • Search returns entries matching criteria; for example, ldapsearch -b "dc=apacheairflow,dc=com" "(uid=bsmith)". section 16.3.1
  • Add, modify, delete, compare, modify DN, abandon, extended, and unbind manage entries, attributes, requests, and connections. section 16.3.1

Airflow LDAP authentication

Configure Airflow to use FAB authentication, enable LDAP registration, select a default role, and provide the directory endpoint and search settings. A representative configuration sets AUTH_TYPE = AUTH_LDAP, AUTH_USER_REGISTRATION = True, AUTH_USER_REGISTRATION_ROLE = "User", AUTH_LDAP_SERVER = "ldap://openldap:389", AUTH_LDAP_SEARCH = "dc=apacheairflow,dc=com", and AUTH_LDAP_UID_FIELD = "uid". After login, FAB searches the directory for the submitted username and password and creates the Airflow user when registration is enabled. section 16.3.2

Figure 16.8 Users are stored in a directory service such as Entra ID or OpenLDAP, which can be accessed with LDAP. This way, a user is created only once and can connect to all applications.

A centralized directory lets one user identity connect to multiple applications instead of being created separately in each application. section 16.3

How Data Pipelines with Apache Airflow, Second Edition covers it

How deep it goes
Defines DITs, entries, attributes, DNs, operations, and Airflow configuration, but does not detail LDAP implementation internals.
Examples
Uses Entra ID, OpenLDAP, DIT entries, ldapsearch commands, and FAB configuration for Airflow login synchronization.
What it assumes
Assumes familiarity with user authentication and Airflow configuration while introducing directory trees, entries, attributes, and LDAP operations.
What you can do after
Apply it by configuring Airflow to authenticate users against LDAP and register them with a default role.
How it connects
Relates LDAP to directory services, authentication, Airflow, FAB, role-based access control, and relational databases.

Also explained in

Compare how 3 books explain Lightweight Directory Access Protocol →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Pipelines with Apache Airflow, Second Edition. The section links point to the parts of the book it draws on.