Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Not able to set password after user created #954

Open
santoshshelar27 opened this issue Nov 17, 2023 · 4 comments
Open

Not able to set password after user created #954

santoshshelar27 opened this issue Nov 17, 2023 · 4 comments

Comments

@santoshshelar27
Copy link

santoshshelar27 commented Nov 17, 2023

Hi Team,
I have a requirement to create a user and set its default password using Node.js. I'm encountering an issue while attempting to set the password after creating the user. Both the "Add" and "Replace" operations result in the following error:

LDAP modify failed: LDAPError [InsufficientAccessRightsError]: Insufficient Access Rights

Key points to note:

  1. I am using an admin user for these operations.
  2. The same user credentials work correctly in a .NET application.
  3. I have referred to this link for additional context: link

I'm using ldapjs v3.0.5

` const change = new ldap.Change({
operation: 'replace',
modification: new ldap.Attribute({
type: 'userPassword',
values: password
})
});
client.modify(userDN, change, (err, res) => {
if (err)
console.error('LDAP modify failed:', err);
console.log("Modify done.")

});`

Your assistance in resolving this issue would be highly appreciated. If there's any additional information needed, please let me know.

@mmjayc
Copy link

mmjayc commented Nov 21, 2023

Does the password you are trying to set, meet your ldap password policy?

@santoshshelar27
Copy link
Author

Yes, the password we are attempting to set does meet the LDAP password policy.

It's worth noting that the same set of details allows us to successfully create a user on LDAP using a .NET application without encountering any issues. Therefore, we believe the password adheres to the LDAP password policy.

@jsumners
Copy link
Member

Please provide a minimal reproducible example (MRE). Doing so will help us diagnose your issue. It should be the bare minimum code needed to trigger the issue, and easily runnable without any changes or extra code. Please review the integration tests, e.g. issue-940.test.js, for examples of good MREs.

You may use a GitHub repository to host the code if it is too much to fit in a code block (or two).

@WanpengQian
Copy link

What is your LDAP server?

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