Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > Authenticating to a remote LDAP SERVER
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 21st March 20:39
kofi
External User
 
Posts: 1
Default Authenticating to a remote LDAP SERVER



I need help.

I have been having a problem connecting to a remote LDAP Server in our
organization. I use
this code to connect to the remote LDAP server from a Red Hat Linux
Box at work:

$login = "myusername";
$pass = "mypassword";
$host = "ldaps://myldaphost.com";

ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);
ldap_set_option(NULL, LDAP_OPT_PROTOCOL_VERSION, 3);
$connection = ldap_connect($host,636);

echo "<br/>On Connection to <b>" . $host . "</b>: " .
ldap_error( $connection ) . "<br/>\n";

$dn = "uid=" . $login . ",dc=myorgranzation,dc=com";
$result = ldap_bind( $connection, $dn, $pass);
echo "<br/>" . ldap_error( $connection ) . "<br/>";

The result on our Corporate Red Hat Linux Box is as follows:

On Connection to ldaps://myldaphost.com: Success

Can't contact LDAP server

However when I use the SAME CODE on my Home-Based OS X Web Server I
get this result:

On Connection to ldaps://myldaphost.com: Success

Success

Aside from the OS, what else could be different? Both systems are
running Apache. Both are
running PHP 5. Why does the same code work on one machine but fail on
the other?

Any help you could offer would be greatly appreciated.

Thanks
Kofi
  Reply With Quote


  sponsored links


2 21st March 20:39
petersprc
External User
 
Posts: 1
Default Authenticating to a remote LDAP SERVER



Does your log show any output from LDAP_OPT_DEBUG_LEVEL?
  Reply With Quote
3 21st March 20:39
adam englander
External User
 
Posts: 1
Default Authenticating to a remote LDAP SERVER


Can you get a valid resource on an ldap_search for the DN? That would
assume you can do anonymously bound searching on the directory.

Adam
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666