Replace(Modify) Users For LDAP Group

USING LDAP CONNECTOR

 

This tutorial talks about how to Modify Users For LDAP Group using LDAP connector.

Prerequisite:

To use the LDAP Connector, you must have the following:

  • Access to either an OpenLDAP, Apache Directory, or MicroSoft Active Directory Instance.
  • Anypoint Studio version 7.0 (or higher) or Anypoint Design Center.

To use the LDAP Connector in a production environment, you must have either:

  • An Enterprise license to use Mule.
  • A CloudHub Starter, Professional, or Enterprise account.

Below LDAP operations are present to Modify user for Ldap group

Modify single value attribute: Replaces the value or values of the attribute defined by attributeName with the new value defined by attributeValue. If the attribute was not present in the entry, then the value is added.

Modify multi value attribute: Replaces the value or values of the attribute defined by attributeName with the new values defined by attributeValues. If the attribute was not present in the entry, then the value is added.

Note: Please be careful while using Modify single/multi value attribute it replaces all the existing users/entries for the ldap group with the new entries

 

Modify single value attribute

Create sample project in anypoint studio and configure listener to trigger the request

Drag and drop LDAP Modify single value attribute operation from mule palette if you can not find LDAP operation in mule palette please add LDAP module using Exchange visit this url for more information

 

 

Provide the Connection Details as given below:

 

Create the transform message to Modify User for LDAP group

%dw 2.0
output application/java
---
{
    "groupDN":"cn=developers,ou=Groups,dc=example,dc=com",
    "attributeName":"uniqueMember",
    "attributeValue":"cn=David Mortier,ou=Users,dc=example,dc=com"
}

 

Pass the below parameters to Modify user for group

DN: provide the group DN value

Attribute Name: Provide the member attribute name for which you want to Modify value

Attribute value: Provide the value of the User DN which you want to Modify

 

 

Existing Entry for developers group, we will replace the uniqueMember attribute

 

Deploy the project and trigger from postman/soapui

 

We can see the old attribute values is replaced with new attribute value for developers LDAP group

 

Modify multi value attribute

 

Drag and drop LDAP Modify multi value attribute operation from mule palette if you can not find LDAP operation in mule palette please add LDAP module using Exchange visit this url for more information

 

 

Provide LDAP connection details

 

Create the transform message to Modify multiple users from group

%dw 2.0
output application/java 
---
{
    "groupDN":"cn=developers,ou=Groups,dc=example,dc=com",
    "attributeName":"uniqueMember",
    "attributeValues":["cn=John Wick,ou=Users,dc=example,dc=com","cn=Philip Mortier,ou=Users,dc=example,dc=com"]
}

 

Pass the below parameters to Modify users from group

DN: provide the group DN value

Attribute Name: Provide the member attribute name from where you want to Modify value

Attribute values: Provide the list of the Users which you want to Modify

 

 

Existing Entry for developers group, we will replace the uniqueMember attribute

 

Deploy the project and trigger from soapui/postman

 

We can see below that 2 users replaced the old attribute value for developers Group

 

Sample application: modifyattribute sample application

 

  
Thank you for taking out time to read the above post. Hope you found it useful. In case of any questions, feel free to comment below. Also, if you are keen on knowing about a specific topic, happy to explore your recommendations as well.
 
For any latest updates or posts on our website, you can follow us on LinkedIn. Look forward to connecting with you there.


Share this:
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments