Welcome! Log In Create A New Profile

Advanced

LDAP Authentication

Posted by crenatovb 
LDAP Authentication
May 02, 2017 04:08PM
Hello guys! Can someone help me?
I need to configure LDAP authentication on NGINX.

Here are my settings:

[root@SERVER conf.d]# nginx -V
nginx version: nginx/1.11.13
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC)
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --user=nginx--group=nginx --with-file-aio --with-google_perftools_module --with-mail --with-mail_ssl_module --with-threads --with-select_module --with-stream --with-stream_ssl_module --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_geoip_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_mp4_module --with-http_perl_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_stub_status_module --with-http_sub_module --with-http_ssl_module --with-http_stub_status_module --with-pcre --with-http_v2_module --with-http_xslt_module --with-poll_module --add-module=/usr/share/nginx/modules/ngx_pagespeed-1.12.34.2-beta --add-module=/usr/share/nginx/modules/ngx_cache_purge-2.3 --add-module=/usr/share/nginx/modules/ngx_slowfs_cache-1.10 --add-module=/usr/share/nginx/modules/ngx_coolkit-0.2rc3 --add-module=/usr/share/nginx/modules/ngx_headers-more-0.32 --add-module=/root/addons/nginx/nginx-auth-ldap/
[root@SERVER conf.d]#

nginx.conf

ldap_server ldapserver {
url ldap://dominio:3268/DC=dominio,DC=gov,DC=br?sAMAccountName?sub?(objectClass=person);
group_attribute uniquemember;
group_attribute_is_dn on;
binddn "CN=user,OU=Contas Servicos,OU=Administrativa,DC=dominio,DC=gov,DC=br";
binddn_passwd password;
require valid_user;
}

.conf

location / {
proxy_pass http://server.dominio.gov.br;
auth_ldap_servers ldapserver;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;



proxy_redirect http://server.dominio.gov.br/system/login.asp http://site.dominio.gov.br;

}
}

Thank you very much for the help. ;)
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 86
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready