php - Authenticating with LDAP OSX 10.8? -
i trying implement login users on web application developing, using open directory , authenticating user through ldap. receiving error of:
warning: ldap_bind() [function.ldap-bind]: unable bind server: can't contact ldap server in /ldap/login.php on line 18 access denied!
my requirement authenticate user through ldap view restricted page. in same way user authenticated using database.
i ran simple test, open connection code below failed authenticate
<?php set_time_limit(30); error_reporting(e_all); ini_set('error_reporting', e_all); ini_set('display_errors',1); $ldaphost = "ldaps://11.4.9.3"; $ldapport = 636; $ds = ldap_connect($ldaphost, $ldapport) or die("could not connect $ldaphost"); if ($ds) { $username = "my ldap login"; $upasswd = "my ldap password"; $ldapbind = ldap_bind($ds, $username, $upasswd); if ($ldapbind) {print "congratulations! $username authenticated.";} else {print "access denied!";} } ?>
any appreciated, if has covered same process know how can achieved.
Comments
Post a Comment