驗證 AD ldap
# AD port number
LDAP (unencrypted): 389 LDAPS (LDAP over SSL/TLS): 636
# linux command
yum install -y openldap-clients ldapsearch -x -H ldap://1.1.1.1 -b "dc=ssorc,dc=local" -D "cn=cross,dc=ssorc,dc=local" -W
# php
error_reporting(E_ALL); ini_set('display_errors', 'On'); $ldap_bind = @ldap_bind($ldap_conn, "cn=$username,$ldap_base_dn", $password); if (!$ldap_bind) { echo "LDAP Bind failed: " . ldap_error($ldap_conn); }
留言