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
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
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
What's in store for DevOps in 2023? Hear from the experts in our "DZone 2023 Preview: DevOps Edition" on Fri, Jan 27!
Save your seat
  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.

Ramesh Mandali user avatar by
Ramesh Mandali
·
Jan. 24, 19 · Tutorial
Like (4)
Save
Tweet
Share
14.95K 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.

Popular on DZone

  • When AI Strengthens Good Old Chatbots: A Brief History of Conversational AI
  • The Enterprise, the Database, the Problem, and the Solution
  • AWS Fargate: Deploying Jakarta EE Applications on Serverless Infrastructures
  • AIOps Being Powered by Robotic Data Automation

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

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

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: