Connecting Tech Pros Worldwide Help | Site Map

Secure LDAP bind fails php

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 10:49 AM
ngiven@hotmail.com
Guest
 
Posts: n/a
Default Secure LDAP bind fails php

Dear PHP Programmers,

Here is what I have:

PHP Version 4.3.8
LDAP Support enabled
RCS Version $Id: ldap.c,v 1.130.2.10 2004/06/01 21:05:33 iliaa Exp $
Total Links 0/unlimited
API Version 2004
Vendor Name OpenLDAP
Vendor Version 20122

I am trying to use LDAP to authenticate my users via LDAP. But I am
running into a problem...

When I try to use ldap_bind() with a secure connection (by specifiying
port 636), the page just hangs.

Here is my code:

<?php

$username = "fake";
$password = "fakepassword";

$reporting = error_reporting( E_ERROR | E_PARSE | E_CORE_ERROR |
E_COMPILE_ERROR | E_USER_ERROR );

$ds=ldap_connect("ldap.byu.edu","636"); // must be a valid LDAP
server!
if ($ds) {
echo "Binding ...";
$bind=ldap_bind($ds, "uid=" . $username . ",ou=People,o=usc.edu",
$password);
if ($bind == false) {
echo "BAD AUTH<br>";
}
else {
echo "bind=" . $bind . "<br>";
echo "userdn=" . $userdn . "<br>";
echo "AUTH OK<br>";
}
}
echo "Closing connection";
ldap_close($ds);
?>


When I load it in a web browser, all I get is "Binding..." and it just
sits there.

If I change the port to 389, it works fine.
Any ideas?

Thanks!
--
Nathan


  #2  
Old July 17th, 2005, 10:55 AM
ngiven@hotmail.com
Guest
 
Posts: n/a
Default Re: Secure LDAP bind fails php

>[color=blue]
> If I change the port to 389, it works fine.
> Any ideas?
>[/color]

Am I the only person that has had this problem? Maybe someone out
there knows a better list to post this question?

Thanks!
--
Nathan

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.