Secure LDAP bind fails php

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ngiven@hotmail.com

    #1

    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 = "fakepasswo rd";

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

    $ds=ldap_connec t("ldap.byu.edu ","636"); // must be a valid LDAP
    server!
    if ($ds) {
    echo "Binding ...";
    $bind=ldap_bind ($ds, "uid=" . $username . ",ou=People,o=u sc.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

  • ngiven@hotmail.com

    #2
    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

    Comment

    Working...