kvspb / nginx-auth-ldap

LDAP authentication module for nginx
BSD 2-Clause "Simplified" License
732 stars 253 forks source link

request failed (32: No such object) #102

Open Difrex opened 8 years ago

Difrex commented 8 years ago

Problem on Debian Jessie, nginx version: nginx/1.8.0. error.log: *2 http_auth_ldap: ldap_search_ext() request failed (32: No such object)

But ldapsearch is working fine

ldapsearch -v -h domain.local -b 'DC=domain,DC=local' -D 'nginx@domain.local'  -x -W '(&(objectCategory=person)(objectClass=user) (sAMAccountName=nginx))'

nginx config

        auth_ldap_cache_enabled on;
        auth_ldap_cache_expiration_time 3600000;
        auth_ldap_cache_size 1000;

ldap_server ad_1 {
        url "ldap://domain.local/dc=domain,dc=local?sAMAccountName?sub?(objectClass=user)";
        binddn "CN=nginx,OU=nginx,OU=TechUsers,DC=xxx,DC=xxx";
        binddn_passwd 'xxx';
        group_attribute member;

        # search for full DN in member object
        group_attribute_is_dn on;

        # matching algorithm (any / all)
        satisfy all;
        require valid_user;
}

server {
        listen xxx:10000;
        server_name xxx;

        location / {
                root /srv/ldap_test;
                index index.html;
                auth_ldap 'restricted area';
                auth_ldap_servers ad_1;
        }
}