Author Topic: [Solved] LDAP Password Change  (Read 2858 times)

Offline sharbich

  • Newbie
  • *
  • Posts: 5
[Solved] LDAP Password Change
« on: May 14, 2021, 04:52:00 AM »
Hello,
I would like to use the password plugin for LDAP in Roundcube. I have the following configuration in "config.inc.php":

Code: [Select]
// Password Plugin options
// -----------------------
$config['password_driver'] = 'ldap_simple';
$config['password_confirm_current'] = true;
$config['password_minimum_length'] = 6;

// ----------------------------------
// LDAP and LDAP_SIMPLE Driver options
// -----------------------------------
$config['password_ldap_host'] = 'ldap.intern.example.com';
$config['password_ldap_port'] = '9009';
$config['password_ldap_starttls'] = false;
$config['password_ldap_version'] = 3;
$config['password_ldap_basedn'] = 'dc=example,dc=com';
$config['password_ldap_method'] = 'admin';
$config['password_ldap_adminDN'] = 'cn=admin,dc=example,dc=com';
$config['password_ldap_adminPW'] = '#############';
$config['password_ldap_userDN_mask'] = 'uid=%login,ou=users,dc=example,dc=com';
$config['password_ldap_searchDN'] = 'cn=admin,dc=example,dc=com';
$config['password_ldap_searchPW'] = '#############';
$config['password_ldap_search_base'] = 'ou=users,dc=example,dc=com';
$config['password_ldap_search_filter'] = '(uid=%login)';
$config['password_ldap_encodage'] = 'crypt';
$config['password_ldap_pwattr'] = 'userPassword';
$config['password_ldap_force_replace'] = true;
Unfortunately I get the following error message after saving.

Code: [Select]
Mai 14 10:37:28 dsme01 roundcube[32410]: PHP Warning:  ldap_modify(): Modify: No such object in /var/www/html/roundcube/plugins/password/drivers/ldap_simple.php on line 90

Do you have any idea what I did wrong?

I'm using Debian Buster and Roundcube version 1.4.8

Greetings from Stefan Harbich
« Last Edit: May 14, 2021, 01:57:22 PM by sharbich »

Offline alec

  • Hero Member
  • *****
  • Posts: 1,363
Re: LDAP Password Change
« Reply #1 on: May 14, 2021, 05:53:29 AM »
Set ldap_debug=true in config to get some more info into the logs.

Offline sharbich

  • Newbie
  • *
  • Posts: 5
Re: LDAP Password Change
« Reply #2 on: May 14, 2021, 06:36:48 AM »
Code: [Select]
Mai 14 12:31:43 dsme01 roundcube[25663]: <do5pm6ot> C: Connect to ldap.intern.exemple.com:9009
Mai 14 12:31:43 dsme01 roundcube[25663]: <do5pm6ot> S: OK
Mai 14 12:31:43 dsme01 roundcube[25663]: <do5pm6ot> C: Bind cn=admin,dc=exemple,dc=com, pass: **** [13]
Mai 14 12:31:43 dsme01 roundcube[25663]: <do5pm6ot> S: OK
Mai 14 12:31:43 dsme01 roundcube[25663]: <do5pm6ot> C: Modify uid=stefan.harbich@example.com,ou=users,dc=example,dc=com: Array
Mai 14 12:31:43 dsme01 roundcube[25663]: (
Mai 14 12:31:43 dsme01 roundcube[25663]:     [userPassword] => {CRYPT}$1$65npTdBX$ESFsub5laHkDt6AMdhqDC1
Mai 14 12:31:43 dsme01 roundcube[25663]: )
Mai 14 12:31:43 dsme01 roundcube[25663]:
Mai 14 12:31:43 dsme01 roundcube[25663]: PHP Warning:  ldap_modify(): Modify: No such object in /var/www/html/roundcube/plugins/password/drivers/ldap_simple.php on line 90
Mai 14 12:31:43 dsme01 roundcube[25663]: <do5pm6ot> S: No such object
Okay, seems like the uid is wrong. This must actually be stefan.harbich. Without @example.com. Just why?

Offline alec

  • Hero Member
  • *****
  • Posts: 1,363
Re: LDAP Password Change
« Reply #3 on: May 14, 2021, 06:44:42 AM »
Try %name instead of %login.

Offline sharbich

  • Newbie
  • *
  • Posts: 5
Re: LDAP Password Change
« Reply #4 on: May 14, 2021, 01:53:14 PM »
Try %name instead of %login.
That was the solution. Thanks.