Delete Users From LDAP Group

 

This tutorial talks about how to delete users from LDAP groups.

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 delete user from group

Delete single value attribute: Deletes the value matching attributeValue of the attribute defined by attributeName. If the entry didn’t have the value, then the entry stays the same. If no value is specified, then the whole attribute is deleted from the entry.

Delete multi value attribute: Deletes all the values matching attributeValues of the attribute defined by attributeName. Values that are not present in the entry are ignored. If no values are specified, then the whole attribute is deleted from the entry.

Note: Please be careful while using delete single/multi value attribute operation as it may delete all the users associated with group if we pass the null value for attribute

 

Delete single value attribute

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

Drag and drop LDAP Delete 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

Delete Users From LDAP Group

 

Provide the Connection Details as given below:

Delete Users From LDAP Group

 

Create the transform message to delete User from LDAP group

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

 

Pass the below parameters to delete user from group

DN: provide the group DN value

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

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

 

Delete Users From LDAP Group

 

Deploy the project and trigger from postman/soapui

 

We can see below that user is deleted from developers LDAP group

Delete Users From LDAP Group

 

Delete multi value attribute

Drag and drop LDAP Delete 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 delete 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=David Mortier,ou=Users,dc=example,dc=com"]
}

 

Pass the below parameters to delete users from group

DN: provide the group DN value

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

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

 

 

Deploy the project and trigger from soapui/postman

 

We can see below that 2 users are deleted from developers Group

 

Sample application: deleteattribute 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
Inline Feedbacks
View all comments