Loading

LDAP Connector - Working with unicodePwd Attribute - Mule 4

Date de publication: Jul 28, 2025
Tâche

GOAL

An application using LDAP connector needs to set/update unicodePwd attribute. For example, when adding a user.
Étapes

Prerequisites

Minimum Mule runtime version: 4.2.1
The password received by application is a text string.
For example: 

<set-variable variableName="password" value="#['super_strong_password']" doc:name="SetVariable - password" />

Add Entry Operation

The following DataWeave payload should be formed to call LDAP Add Entry operation: 
%dw 2.0
output application/java
---
{
	dn : "CN=" ++ vars.cnUserName ++ p('baseDN'),
	cn : vars.cnUserName,
	mail : vars.cnUserName ++ "@contoso.com",
	unicodePwd: write(('"' ++ vars.password ++ '"') as Binary {encoding: "UTF-16LE"},"application/java"),
	"objectClass": [
            "person",
            "user",
            "top",
            "organizationalPerson",
            "inetOrgPerson"
        ]
}
Important, the string that represents the password needs to be specified in a UTF-16 encoded Unicode string containing the password surrounded by quotation marks, which has been BER-encoded as an octet string per the Object(Replica-Link) syntax: unicodePwd 

Modify Single Value Attribute Operation

<ldap:modify-single-value-attribute doc:name="Modify single value attribute" doc:id="a954ba1c-c8f2-4189-88a2-ac430d401c8a" config-ref="LDAP_Configuration" 
    dn="#[&quot;CN=&quot; ++ vars.cnUserName ++ p('baseDN')]" 
    attributeName="unicodePwd" 
    attributeValue="#[('&quot;' ++ vars.password ++ '&quot;') as Binary {encoding: &quot;UTF-16LE&quot;}]" 
    ignoreInvalidAttribute="false" />
More information can be found at LDAP Connector - Mule 4

ADDITIONAL INFORMATION

When the unicodePwd attribute is not specified in a UTF-16 encoded Unicode string, the following error message will be printed in the application logs:
OPERATION_NOT_SUPPORTED: [LDAP: error code 53 - 0000001F: SvcErr: DSID-031A124C, problem 5003 (WILL_NOT_PERFORM), data 0
Numéro d’article de la base de connaissances

001116620

 
Chargement
Salesforce Help | Article