PHP, LDAP and Windows Integrated Authentication

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Good morning all,

System platform:
Server with W2K3, IIS6 and PHP 5
Workstation with XP SP3.

I make a search into my LDAP.
It works but I need to make the bind with a username/password couple

Code below:
<?php
 $ldap_user = substr($_SERVER['AUTH_USER'],7)."@domaine.com"; 
 $ldap_pass); //here putting the password for ^$ldap_user;
 $ldap_host = 'ldap.domaine.com';
 $ldap_domain= 'ldap-domain';
 $base_dn='ou=USER,OU=OrgUnit,dc=domain,dc=com';
 $filter='(cn=*)';
 $connect=ldap_connect($ldap_host,389) or exit('>>Could not connect to LDAP server<<');
 $bind=ldap_bind($connect,$ldap_user,$ldap_pass) or exit('<<Could not bind to $ldap_host<<');
 $read=ldap_search($connect,$base_dn,$filter);
 $info=ldap_get_entries($connect,$read);
 echo $info['count'].' entries returned<p>';
 echo "<br>";

 for ($i=0;$i<$info['count']; $i++)
 {
  $info_cn = $info[$i]['initials'][0];
  echo 'cn = '.$info_cn.'<BR>';
 }
?>

I want use the Windows Integrated Authentication to send to my ldap_bind command the current user/password instead of hardcoded it into the php script.

Regards,

C.B

[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux