Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jjayaraman opened this issue Apr 25, 2019 · 6 comments

Comments

@jjayaraman
Copy link

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?

@tastypackets
Copy link

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

@jjayaraman
Copy link
Author

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

@tastypackets
Copy link

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.

@jjayaraman
Copy link
Author

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,

@omairnabiel
Copy link

    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

@jsumners
Copy link
Member

⚠️ This issue has been locked due to age. If you have encountered a recent
problem that seems to be covered by this issue, please open a new issue.

Please include a minimal reproducible example
when opening a new issue.

@ldapjs ldapjs locked as resolved and limited conversation to collaborators Mar 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants