|
Posted by yawnmoth on August 4, 2008, 3:09 pm
Please log in for more thread options > > I'm trying to connect to an Active Directory server and am having some
> > difficulties. =A0Here's the code I'm using:
>
> ><?php
> > if (!($ldap =3D ldap_connect('domain.tld'))
> > {
> > =A0 =A0exit('unable to connect');
> > }
>
> > ldap_bind($ldap, 'username', 'password');
> > ?>
>
> > With that code, I get the following error:
>
> > Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server:
> > Invalid credentials in C:\htdocs\test.php on line 10
>
> > The thing is... =A0I can connect just fine using Active Directory
> > Explorer v1.01 [1] =A0using the same info as above. =A0The only thing I
> > can figure is that Active Directory Explorer is doing something that
> > PHP doesn't. =A0Maybe it connects to a different port than PHP does by
> > default? =A0Maybe it appends something to the username?
>
> > [1]http://www.microsoft.com/technet/sysinternals/networking/adexplorer.=
mspx
>
> Can you run Wireshark on the two sets of transactions
> and post the (sanitized) traces?
I actually figured it out - Active Directory Explorer automatically
appends the domain name to the username (eg. user@domain.tld), whereas
PHP, I guess, doesn't, and instead, requires you manually add it.
|