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
Provide the Connection Details as given below:
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
Deploy the project and trigger from postman/soapui
We can see below that user is deleted from developers 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