LDAP Integration - can't login

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:


Or for longer, use three backticks above and below the code snippet:


Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 20.0.10
Operating system and version (eg, Ubuntu 20.04): 11.1.0
Apache or nginx version (eg, Apache 2.4.25): apache 2.4.41-4
PHP version (eg, 7.4): 7.4.3

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. LDAP integration > Login Attributes

The output of your Nextcloud log in Admin > Logging:

nextcloud log empty. 

{"reqId":"7q8XJ3X4jgpMOJ8qZh8J","level":1,"time":"2021-06-04T13:15:46+02:00","remoteAddr":"","user":"--","app":"admin_audit","method":"POST","url":"/index.php/login","message":"Login attempt: \"nextcloud\"","userAgent":"Mozil

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

    $CONFIG = array (
      'passwordsalt' => '**xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx**',
      'secret' => '**xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx**',
      'trusted_domains' =>.
      array (
        0 => '**xxxxxxxxxx**',
        1 => '',
        2 => 'nextcloud',
        3 => 'nextcloud',
      'datadirectory' => '/mnt/ncdata',
      'dbtype' => 'pgsql',
      'version' => '',
      'overwrite.cli.url' => 'https://nextcloud/',
      'dbname' => 'nextcloud_db',
      'dbhost' => 'localhost',
      'dbport' => '',
      'dbtableprefix' => 'oc_',
      'dbuser' => 'ncadmin',
      'dbpassword' => '**xxxxxxxx**',
      'installed' => true,
      'instanceid' => 'och7z8f5qeof',
      'log_type' => 'file',
      'logfile' => '/var/log/nextcloud/nextcloud.log',
      'loglevel' => '4',
      'log.condition' =>.
      array (
        'apps' =>.
        array (
          0 => 'admin_audit',
      'mail_smtpmode' => 'smtp',
      'logtimezone' => 'Europe/Warsaw',
      'maintenance' => false,
      'mail_smtpsecure' => 'ssl',
      'mail_sendmailmode' => 'smtp',
      'mail_from_address' => 'nextcloud',
      'mail_domain' => '**xxxxxxxxxxxxxxxxxxx**',
      'mail_smtpauthtype' => 'PLAIN',
      'mail_smtpauth' => 1,
      'mail_smtphost' => '**xxxxxxxxxxxxxxxxxxxxx**',
      'mail_smtpport' => '465',
      'mail_smtpname' => '**xxxxxxxxxxxxxxxxx**',
      'mail_smtppassword' => '**xxxxxxxxxxxxxxxxxxx**',
      'ldapIgnoreNamingRules' => false,
      'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
      'app_install_overwrite' =>.
      array (
        0 => 'ldaporg',

The output of your Apache/nginx/system log in /var/log/____:

nextcloud.xxxxxxxxxx.eu:443 - - [04/Jun/2021:13:17:28 +0200] "PUT /index.php/apps/user_status/heartbeat HTTP/2.0" 204 475 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0"
nextcloud.xxxxxxxxx.eu:443 - - [04/Jun/2021:13:17:28 +0200] "GET /ocs/v2.php/apps/user_status/api/v1/user_status HTTP/2.0" 200 218 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0"
nextcloud.xxxxxxxxxx.eu:443 - - [04/Jun/2021:13:17:28 +0200] "GET /apps/user_status/img/user-status-away.svg HTTP/2.0" 200 526 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0"

Hello, I want to AD integration with nextcloud. Configuration is fine, I see users, groups, but on Login Attributes two checkbox are greyed out and I canot change them.
I Edit LDAP query manually to

(&(|(|(memberof=CN=Domain Users,CN=Users,DC=domain,DC=eu)

And verify settings is working, it found user.

  1. I can’t login via LDAP, I get error with wrong credentials.
  2. I want to enable mail address in login attributes

Where is the problem ?

Good morning friend, can you please attach all your ldap app configuration tabs?

Lets analyze that first.


Sorry, I’m a new user, I Can send only 2 files.
Merge posts please

1 Like

Can you please mark the “LDAP / AD Email Address” inside de Login Attributes?

Test if you can login using the mail attribute after that.

Good luck mate.

That’s the point. I Cannot change it. It’s grayed out as you see

But can you manually edit that?

If so, insert this at the end: (|(samaccountname=%uid)(|(mailPrimaryAddress=%uid)(mail=%uid))))

Did you get it?

I put this in LDAP query but it’s not working. When verify settings I get an error
The search filter is invalid, probably due to syntax issues like uneven number of opened and closed brackets. Please revise.
I can’t login too on main page

Hey man, please insert your login filter here, so I can check if everything’s fine.

Probably it’s a bracket() that’s causing this problem.

I recommend to you, to put your query into notepad++ and see if every bracket that was opened (, was closed ).

Did you get it?

It’s working now… I had to click edit LDAPQuery and it generate query with email option login.
Thanks for your help

I have another question. This version stands on Ubuntu 11.xx. I used apliance virtual drive disk.
Don’t like Ubuntu, so I install next on Centos 8.1 on apache. Version 21.0.2
I have a problem with LDAP Connection
I copy the same settings from Ubuntu server, but it’s not showing port.

Selinux disabled, firewall disabled, I can telnet domain controller on port 389 and it’s listning.
I can use ldapserch and it’s working too on cli. Php-ldap installed but it’s not working on www.

The same problem here

I added to every file in ajax folder require… but nothing happend

EDIT > ALL working now, had to change root directory in apache