nginx-ldap-auth icon indicating copy to clipboard operation
nginx-ldap-auth copied to clipboard

401 unauthorized

Open vadimiv opened this issue 3 years ago • 1 comments

Hi. If i use ldapsearch all requests are successful. But
curl --location --request GET 'http://localhost:8888' --header 'X-Ldap-URL: ldap://test.local:389' --header 'X-Ldap-BaseDN: DC=test,DC=local' --header 'X-Ldap-BindDN: nginx_ldap' --header 'X-Ldap-BindPass: ' --header 'X-Ldap-Template: (sAMAccountName=%(username)s)' -vv -u nginx_ldap: returned 401 aunauthorized

  • Connected to localhost (::1) port 8888 (#0)
  • Server auth using Basic with user 'nginx_ldap'

GET / HTTP/1.1 Authorization: Basic bmdpbnhfbGRhcDoyd3N4QFdTWA== User-Agent: curl/7.29.0 Host: localhost:8888 Accept: / X-Ldap-URL: ldap://test.local:389 X-Ldap-BaseDN: DC=bft,DC=local X-Ldap-BindDN: nginx_ldap X-Ldap-BindPass: **** X-Ldap-Template: (sAMAccountName=%(username)s)

  • HTTP 1.0, assume close after body < HTTP/1.0 401 Unauthorized < Server: BaseHTTP/0.3 Python/2.7.18 < Date: Tue, 05 Jul 2022 14:58:49 GMT
  • Authentication problem. Ignoring this. < WWW-Authenticate: Basic realm="Restricted" < Cache-Control: no-cache <
  • Closing connection 0 Can somebody help please?

vadimiv avatar Jul 05 '22 15:07 vadimiv

Can you share the log output please? It should print the result of your LDAP Query.

tippexs avatar Jul 12 '22 06:07 tippexs