Node-ldapjs: Is it possible to do password reset, when user does not know the current passsword?

Created on 25 Apr 2019  路  5Comments  路  Source: ldapjs/node-ldapjs

Thanks for the great library.

Is it possible to do a password reset, when the user does not know the current password?

I am able to change the password if the user knows the current password. But also needs to reset the password, if the user forgot the current password. Is this possible at all?

Most helpful comment

I think you need to use replace instead of add and delete, I believe when you send an add and del together it treats it as a normal reset. When you send only a replace command it's treated like an administrator password reset.

All 5 comments

I think you'd have to use a service account to perform the password reset.

I think you'd have to use a service account to perform the password reset.

Thanks, this is my full question on StackOverflow, https://stackoverflow.com/questions/55847431/nodejs-ldapjs-activedirectory-password-reset-without-knowing-current-password

I think you need to use replace instead of add and delete, I believe when you send an add and del together it treats it as a normal reset. When you send only a replace command it's treated like an administrator password reset.

I think you need to use replace instead of add and delete, I believe when you send an add and del together it treats it as a normal reset. When you send only a replace command it's treated like an administrator password reset.

Many thanks, mate, it worked and solved my issue,

    const change = new ldap.Change({
      operation: 'replace',
      modification: { unicodePwd: encodePassword(newPassword) },
    });

    client.modify(`CN=${name},CN=Users,${server.baseDN}`, change, function(err) {
      if (err) {
        return err;
      }
      return true;
    });

This is what you mean when you say use replace? @tastypackets

Was this page helpful?
0 / 5 - 0 ratings

Related issues

UziTech picture UziTech  路  4Comments

SeanPlusPlus picture SeanPlusPlus  路  5Comments

sorccu picture sorccu  路  5Comments

sean256 picture sean256  路  5Comments

ifroz picture ifroz  路  8Comments