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
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Because the DevOps movement has redefined engineering responsibilities, SREs now have to become stewards of observability strategy.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Related

  • Easy Oracle Database Migration with SQLcl
  • Setting Apache Nifi on Docker Containers
  • How to Improve Copilot's Accuracy and Performance in Power BI
  • Building a Real-Time Change Data Capture Pipeline With Debezium, Kafka, and PostgreSQL

Trending

  • How to Create a Successful API Ecosystem
  • Introducing Graph Concepts in Java With Eclipse JNoSQL
  • The Evolution of Scalable and Resilient Container Infrastructure
  • Supervised Fine-Tuning (SFT) on VLMs: From Pre-trained Checkpoints To Tuned Models
  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 user avatar
Ramesh Mandali
·
Jan. 24, 19 · Tutorial
Likes (4)
Comment
Save
Tweet
Share
17.3K Views

Join the DZone community and get the full member experience.

Join For Free

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
  • Setting Apache Nifi on Docker Containers
  • How to Improve Copilot's Accuracy and Performance in Power BI
  • Building a Real-Time Change Data Capture Pipeline With Debezium, Kafka, and PostgreSQL

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

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 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!