LDAP/AD Integration don't work

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 30.0.5
  • Operating system and version (e.g., Ubuntu 24.04):
    • Debian 12
  • Web server and version (e.g, Apache 2.4.25):
    • Apache 2.4.62
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • No nginx
  • PHP version (e.g, 8.3):
    • 8.2.26
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • Now
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • On VM, I’m using Proxmox ad hypervisor
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No, self hosted VM

Summary of the issue you are facing:

LDAP/AD integration fails.
The parameters are these:


Sorry but my nextcloud instance is in Italian.

These are all test machines so I can share all the necessary information, since it is not exposed on the internet and everything will be dismantled.

Steps to replicate it (hint: details matter!):

  1. Go on " Integrazione LDAP/AD".
  2. Set all parameters as shown in the image.
  3. Click on “Rileva DN base”.

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

{"reqId":"Z5Iq_hv-v5UrNm4ApLzWAgAAAAc","level":2,"time":"2025-01-23T11:41:50+00:00","remoteAddr":"100.68.93.68","user":"admin","app":"user_ldap","method":"POST","url":"/index.php/apps/user_ldap/ajax/wizard.php","message":"Configuration Error (prefix s02): No LDAP Login Filter given!","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0","version":"30.0.5.1","data":{"app":"user_ldap"},"id":"67922d3ca062d"}
{"reqId":"Z5Iq_hv-v5UrNm4ApLzWAgAAAAc","level":2,"time":"2025-01-23T11:41:50+00:00","remoteAddr":"100.68.93.68","user":"admin","app":"user_ldap","method":"POST","url":"/index.php/apps/user_ldap/ajax/wizard.php","message":"Configuration Error (prefix s02): login filter does not contain %uid place holder.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0","version":"30.0.5.1","data":{"app":"user_ldap"},"id":"67922d3ca0626"}
{"reqId":"Z5Iq_hv-v5UrNm4ApLzWAgAAAAc","level":2,"time":"2025-01-23T11:41:50+00:00","remoteAddr":"100.68.93.68","user":"admin","app":"user_ldap","method":"POST","url":"/index.php/apps/user_ldap/ajax/wizard.php","message":"Configuration Error (prefix s02): No LDAP Login Filter given!","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0","version":"30.0.5.1","data":{"app":"user_ldap"},"id":"67922d3ca061f"}
{"reqId":"Z5Iq_hv-v5UrNm4ApLzWAgAAAAc","level":2,"time":"2025-01-23T11:41:50+00:00","remoteAddr":"100.68.93.68","user":"admin","app":"user_ldap","method":"POST","url":"/index.php/apps/user_ldap/ajax/wizard.php","message":"Configuration Error (prefix s02): login filter does not contain %uid place holder.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0","version":"30.0.5.1","data":{"app":"user_ldap"},"id":"67922d3ca0619"}
{"reqId":"Z5Iq_xv-v5UrNm4ApLzWBAAAAAc","level":2,"time":"2025-01-23T11:41:51+00:00","remoteAddr":"100.68.93.68","user":"admin","app":"user_ldap","method":"POST","url":"/index.php/apps/user_ldap/ajax/wizard.php","message":"Configuration Error (prefix s02): No LDAP Login Filter given!","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0","version":"30.0.5.1","data":{"app":"user_ldap"},"id":"67922d3ca0611"}
{"reqId":"Z5Iq_xv-v5UrNm4ApLzWBAAAAAc","level":2,"time":"2025-01-23T11:41:51+00:00","remoteAddr":"100.68.93.68","user":"admin","app":"user_ldap","method":"POST","url":"/index.php/apps/user_ldap/ajax/wizard.php","message":"Configuration Error (prefix s02): login filter does not contain %uid place holder.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0","version":"30.0.5.1","data":{"app":"user_ldap"},"id":"67922d3ca060a"}
{"reqId":"Z5Iq_xv-v5UrNm4ApLzWBAAAAAc","level":2,"time":"2025-01-23T11:41:51+00:00","remoteAddr":"100.68.93.68","user":"admin","app":"user_ldap","method":"POST","url":"/index.php/apps/user_ldap/ajax/wizard.php","message":"Configuration Error (prefix s02): No LDAP Login Filter given!","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0","version":"30.0.5.1","data":{"app":"user_ldap"},"id":"67922d3ca0603"}
{"reqId":"Z5Iq_xv-v5UrNm4ApLzWBAAAAAc","level":2,"time":"2025-01-23T11:41:51+00:00","remoteAddr":"100.68.93.68","user":"admin","app":"user_ldap","method":"POST","url":"/index.php/apps/user_ldap/ajax/wizard.php","message":"Configuration Error (prefix s02): login filter does not contain %uid place holder.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0","version":"30.0.5.1","data":{"app":"user_ldap"},"id":"67922d3ca05fa"}

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

root@nextcloud ~# cat /var/www/nextcloud/config/config.php
<?php
$CONFIG = array (
  'passwordsalt' => '0d9476e0e0a74bee6480664ef680d710',
  'secret' => '3ef9ea75050d3e3544fe1b4515a0c86d41266b52423151d995364d0891777af94ddf484d949b717b633073e89469471f',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => 'nextcloud.nextcloud.local',
  ),
  'datadirectory' => '/var/www/nextcloud-data',
  'dbtype' => 'mysql',
  'version' => '30.0.5.1',
  'overwrite.cli.url' => 'http://localhost',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'a2e4ab17f3f32efffb83ad8f79c32d92',
  'installed' => true,
  'instanceid' => 'c3d5c6e2509ec',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
  ),
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'log_type' => 'file',
  'logfile' => '/var/www/nextcloud-data/nextcloud.log',
  'loglevel' => 3,
  'updater.secret' => '$2y$10$v3TpUSvBwTtIHR.xqfGMs.Kjy4BboW0COgGGbGfjb9zQUTX6M4MEi',
  'maintenance' => false,
  'theme' => '',
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'forbidden_filename_basenames' =>
  array (
    0 => 'con',
    1 => 'prn',
    2 => 'aux',
    3 => 'nul',
    4 => 'com0',
    5 => 'com1',
    6 => 'com2',
    7 => 'com3',
    8 => 'com4',
    9 => 'com5',
    10 => 'com6',
    11 => 'com7',
    12 => 'com8',
    13 => 'com9',
    14 => 'com¹',
    15 => 'com²',
    16 => 'com³',
    17 => 'lpt0',
    18 => 'lpt1',
    19 => 'lpt2',
    20 => 'lpt3',
    21 => 'lpt4',
    22 => 'lpt5',
    23 => 'lpt6',
    24 => 'lpt7',
    25 => 'lpt8',
    26 => 'lpt9',
    27 => 'lpt¹',
    28 => 'lpt²',
    29 => 'lpt³',
  ),
  'forbidden_filename_characters' =>
  array (
    0 => '<',
    1 => '>',
    2 => ':',
    3 => '"',
    4 => '|',
    5 => '?',
    6 => '*',
    7 => '\\',
    8 => '/',
  ),
  'forbidden_filename_extensions' =>
  array (
    0 => ' ',
    1 => '.',
    2 => '.filepart',
    3 => '.part',
  ),
);

I hope I have provided all the necessary information, if necessary just ask.