DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Easy Oracle Database Migration with SQLcl
  • Share Delta Lake Tables Between Databricks and Snowflake
  • Why Vulnerability Management Fails Without Reliable Asset Data
  • Engineering Audit-Ready Data Pipelines for Regulatory Reporting

Trending

  • Taming Parameter Sniffing in SQL Server 2022 With PSP Optimization
  • Two Engines, One Query: DuckDB Inside Neo4j
  • Data Integration Landscape 2026: Event Streaming, API, and Batch in the Era of Agentic AI
  • PostgreSQL vs Oracle: When Higher Cost Means Better Performance

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Data Engineering
  3. Data
  4. Mule 4 LDAP Operations

Mule 4 LDAP Operations

Learn how to connect to any LDAP server and perform every LDAP operation.

By 
Ramesh Mandali
·
Jan. 24, 19 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
18.0K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

Lightweight Directory Access Protocol (LDAP) is a client/server protocol used to access and manage directory information. It reads and edits directories over IP networks and runs directly over TCP/IP using simple string formats for data transfer. It was originally developed as a front end to X.500 Directory Access Protocol. Lightweight Directory Access Protocol is also known as RFC 1777.

The LDAP Connector will allow to connect to any LDAP server and perform every LDAP operation. We have implemented a few basic operations in Mule 4.

Search Operation

Step1: Create a project in anypoint studio and drag and drop all the required components from mule component palette as shown in below flow.

Mule 4 LDAP operations:

  • Search
  • Create OU(organizationalUnit)
  • Create a user
  • Modify
  • Delete

Prerequisites:

  1. Anypoint studio 7
  2. Java 8
  3. OpenLDAP, OUD, OID, Microsoft AD.

Acronyms:

DN

Distinguished Name

DC

Domain Component

CN

Common Name

SN

Sir Name

OU

Organizational Unit

OUD

Oracle Unified Directory

OID

Oracle Internet Directory

AD

Active Directory(Microsoft)

Search Operation

Step1: Create a project in anypoint studio and drag and drop all the required components from the Mule component palette as shown in the below flow.

Mule flow

Step2: Install Oracle unified directory LDAP server, as mentioned in the below screenshot. Next, traverse the tree structure of the LDAP server.

Image titleStep3: In the search component, we must configure LDAP server details.

Image title

Step4: After configuring LDAP server details, we must provide the Distinguished Name (DN) and filter (should be Common Name (CN)) these are the main fields to search in the LDAP server.

Image title

Step5: Once you run the application, it must be deployed status.

Image title

Step6: To test the result, open postman and hit the send button. See the result as below. Common name ramesh has taken as filter so that result given as below. localhost:8089/oud

Image title

Create OU (Organizational Unit)

Step1: Create a project in Anypoint studio. Drag and drop all the required components from mule component palette as mentioned in below flow.

Image title

Step2: In add entry component we need to select the structural class as organizationalUnit because I am creating a group on to the LDAP server to create multiple users on this unit.

Image title

Step3: In dataweave, I am creating a group called DevOpsGroup like organizational Unit (OU). Here, I am getting Distinguished Name(dn) from queryparams.

Top Class: is the super class of all the classes in every LDAP server’s language. if you want to create any user or OU etc…. we must import top class.

Image title

Step4: Once we hit the API from Postman, we can see the logs for add entry operation in the console like below for organizational Unit.

Image title

Logs:

Image title

Step5: I have logged into OUD LDAP server and refreshed it to get the updated entry on to the server. Now I can able to see the LDAPGroup OU creation.

Image title

Create a user under OU:

Step1: Create a project in Anypoint studio. Drag and drop all the required components from mule component palette as mentioned in below flow.

Image title

Step2: In add entry component, we need to select the structural class as Person because I am creating a user on to the LDAP server.

Image title

Step3: In dataweave, I am creating a user LdapUser as common name (cn) into DevOpsGroup organizationalUnit(OU). Here I am getting Distinguished Name (dn) from queryparams.

Image title

Step4: Once we hit the API from Postman, we can see the logs for add entry operation in the console like below.

Image title

Logs:

Image title

Step5: I have logged into OUD LDAP server and refreshed it to get the updated entry on to the server. Now, I am able to see the LdapUser creation.

Image title

Modify a User:

Step1: Create a project in Anypoint studio. Drag and drop all the required components from the Mule component palette as the below flow shows.

Image title

Step2: In the modify entry component, we need to select the structural class as Person because I am modifying a user’s data on to the LDAP server.

Image title

Step3: Before modifying the user’s data, the dataweave code needs to be written as mentioned below.

Image title

Step4: After the modified user’s data, dataweave should be like below. Here, I am trying to modify LdapUser’s data.

Image title

Step5: Once we hit the API from Postman, can see the logs for modified entry data in the console like below.

Image title

Logs:Image title

Step5: Before modify user’s data in OUD LDAP server.

Image title

After the modified operation, user’s data is changed as shown below.

Image title

Delete operation:

Step1: Create a project in Anypoint studio. Drag and drop all the required components from the Mule component palette as mentioned in the below flow.

Image title

Step2: In the delete component, we must provide the DN. The user will delete based on the DN condition like below.

Image title

Step3: Once we hit the API from Postman, we can see the logs for add entry operation in the console like below.

Image title

Logs:

Image title

Step4: Before deleting a user on the LDAP server, we can see Test User as mentioned in the below screen.

Image title

After deleting a user on LDAP server.

Image title

Data (computing) Directory

Opinions expressed by DZone contributors are their own.

Related

  • Easy Oracle Database Migration with SQLcl
  • Share Delta Lake Tables Between Databricks and Snowflake
  • Why Vulnerability Management Fails Without Reliable Asset Data
  • Engineering Audit-Ready Data Pipelines for Regulatory Reporting

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook