Created
March 4, 2023 18:36
-
-
Save kgust/4971d3b395ecbd535b60de76a6ec0571 to your computer and use it in GitHub Desktop.
Testing LDAP Bind
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// using ldap bind | |
$ldaprdn = $RDN; // ldap rdn or dn | |
$ldappass = $PASS; // associated password | |
// connect to ldap server | |
$ldapconn = ldap_connect($ldapUrl) | |
or die("Could not connect to LDAP server."); | |
if ($ldapconn) { | |
// binding to ldap server | |
$ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass); | |
// verify binding | |
if ($ldapbind) { | |
echo "LDAP bind successful..."; | |
} else { | |
echo "LDAP bind failed..."; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment