How do i create a control
See original GitHub issueI’m trying to reset PWD in AD while honoring password history. I’m using this article as reference. AD requires that I pass a control (1.2.840.113556.1.4.2239 or 1.2.840.113556.1.4.2066) with the modification for a reset (replace not delete/add - no original pwd).
My first question is do I use a regular Control or ServerSideSortingRequestControl? I’m guessing the later, either way when I try to create the control i get various errors.
The latest error is ‘Missing required key: attributeType’
//var pwdhint = new ldap.Control({
var pwdhint = new ldap.ServerSideSortingRequestControl({
type: "1.2.840.113556.1.4.2239",
criticality: false,
value: value
});
client.modify('CN=Test,OU=Users,DC=Domain,DC=com',
new ldap.Change({
operation: 'replace',
modification: {
unicodePwd: encodePassword(newPassword)
}
}), pwdhint, function(result, error){
if (error) (console.log(error));
console.log(result);
});
And my second question is how do I create the “value” parameter. No matter how I create I get a TypeError. This says it should be a byte array and the previous article I referenced said the value should be “0x1”
If I pass the control without specifying the value it appears that the control is ignored. As PWD history is ignored and the ModifyResponse.controls is empty
Would appreciate some help
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (4 by maintainers)
Top GitHub Comments
It is disappointing that neither the docs nor the issue tracker appear to have a working example of a Control.
Probably this is a bug in library. here is the spec of how it should work https://tools.ietf.org/html/rfc4511#section-4.1.11