kvspb / nginx-auth-ldap

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

How to configure nginx with windows AD? #167

Open tianjiaolaozu opened 7 years ago

tianjiaolaozu commented 7 years ago

I have successfully added "nginx-auth-ldap" to nginx when do the configure with centos7(after have a lots of trouble with centos6, so I strongly recommend you to try centos7 ). However, I do not have much luck with company AD, my config in nginx.conf file is like below

    ldap_server openldap {

    url "ldap://<ADIP>:389/ou=Domain Users,dc=<companydomain>,dc=com?sAMAccountName?sub?(&(objectClass=*))";

    #binddn "cn=Manager,dc=companydomain,dc=com";
    #binddn_passwd "secret";
    group_attribute memberuid;
    group_attribute_is_dn on;
    require valid_user;
                         }

Anyone can suggest whether I should uncomment binddb and binddn_passwd or how need I to modify add config file? Instant response will be much appreciated.

Regards,

James Pei

Vitiate commented 7 years ago

url ldap://dc1.local:3268/DC=du,DC=local?sAMAccountName?sub?(objectClass=person); binddn "DULOCAL\username"; binddn_passwd "password"; group_attribute uniquemember; group_attribute_is_dn off; require valid_user; ssl_check_cert off;

The above is working config against AD

jandrieu commented 7 years ago

FWIW, I was not able to get LDAP to work with a bind dn of the form "CN=Name, OU=XXX, DC=YYY" When I changed to "DOMAIN\username" or "user@example.com", it would work.

fvm2000 commented 7 years ago

I just finished getting nginx-auth-ldap up and running on RHEL7. Here are a couple of comments from the experience:

tianjiaolaozu commented 7 years ago

Hello @Vitiate I am quite experienced in AD and my domain name is htwon.com and if I run dsquery user, it will show: "CN=Administrator,CN=Users,DC=htwon,DC=com" Any advice for my below configuration? -----------------------------------------------------------------------------------------------------------------= url ldap://Domain IP:3268/DC=htwon,DC=com?sAMAccountName?sub?(objectClass=Users); binddn "administrator@htwon.com"; binddn_passwd password; group_attribute uniquemember; group_attribute_is_dn off; require valid_user; ssl_check_cert off; }

hablutzel1 commented 3 years ago

For troubleshooting LDAP integration problems you could enable network inspection with a tool like Wireshark that understands LDAP and could show you some helpful data for as in the following example:

image