question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How do i create a control

See original GitHub issue

I’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:open
  • Created 7 years ago
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
kylecordescommented, Sep 8, 2017

It is disappointing that neither the docs nor the issue tracker appear to have a working example of a Control.

1reaction
saostadcommented, Apr 12, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Control Chart: A Key Tool for Ensuring Quality and Minimizing ...
Collect your data and plot it on the control chart. Calculate the average of your data and add a control line. Calculate upper...
Read more >
How to Create a Control Chart: 10 Steps (with Pictures)
1. Check to see that your data meets the following criteria: Data should usually be normally distributed revolving around a mean (average). In the example...
Read more >
Creating a Control - Programming Visual Basic .NET [Book]
To do this in Visual Studio . NET's Windows Forms Designer, perform the following steps: Choose Project→Add User Control from the main menu....
Read more >
Create a control - Product Documentation | ServiceNow
Controls are automatically generated when you associate a policy with an entity type or an entity type with a control objective.
Read more >
How to create a control chart in Tableau ... - The Data School
Create a control parameter, 'Choose sd', as an integer with a range of 1 to 3 and a step of 0.1. Custom format...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found