Afli Mohamed Ghayth
Afli Mohamed Ghayth

Reputation: 1

Spring Boot LDAP Password Change Doesn't Take Effect in Active Directory

I'm working on a Spring Boot 3.4.2 application where I'm integrating Active Directory (AD) via LDAP. I need to update a user's password using LDAP admin credentials, but I'm facing an issue:

The userPassword attribute is updated successfully. However, I can still log in with the old password, and the new password does not work.

Code I'm Using to Update the Password

DirContextOperations context = ldapTemplate.lookupContext(dn);
context.setAttributeValue("userPassword", newPassword);
ldapTemplate.modifyAttributes(context);

My Configuration (application.properties)

spring.ldap.urls=ldap://******:389
spring.ldap.base=dc=otbs,dc=local
spring.ldap.username=CN=Administrator,CN=Users,DC=otbs,DC=local
spring.ldap.password=******

Environment Details:

What I Have Tried:

  1. Verified that ldapTemplate.modifyAttributes(context); executes without errors.
  2. Confirmed that no exceptions are thrown during password update.
  3. Tried using unicodePwd instead of userPassword, but it resulted in an error.

Questions:

Any help would be greatly appreciated!

Upvotes: -2

Views: 34

Answers (0)

Related Questions