kvspb / nginx-auth-ldap

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

http_auth_ldap: Could not find user DN #163

Closed yudao closed 7 years ago

yudao commented 7 years ago

Hi,

I'm using nginx-auth-ldap for the first time and I'm facing of an incomprehensive error when I'm trying to connect:

2017/01/28 22:45:34 [error] 7#7: *7 http_auth_ldap: Could not find user DN, client: 10.131.6.166, server: localhost, request: "GET / HTTP/1.1", host: "mydomain.mytld"

I usually use Apache and LDAP and it's working without any problem.

This is a gist with a concrete example of one of my apache .htaccess ldap authentication that's work and my nginx configuration that give me this error.

https://gist.github.com/anonymous/e38bcfebadb246567eae395c38c872d2

I've tested many things, with sometimes some errors, but easily to correct.

I'll appreciate any help.

Thank a lot.

Yu.

yudao commented 7 years ago

Found a way to work.

Before : url ldap://ldap.mydomain.mytld:389/dc=mydomain,dc=mytld?uid;

After: url "ldap://ldap.mydomain.mytld:389/dc=mydomain,dc=mytld?uid?sub?(&(objectClass=inetOrgPerson))";

Sorry for disturbing.

Yo.