473,396 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

Jul 17 '05 #1
1 2651
>
If I change the port to 389, it works fine.
Any ideas?


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

Thanks!
--
Nathan

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Amar | last post by:
I am trying to connect to my college LDAP directory using ASP.NET. This LDap does not have security as it returns only user demographic information. I can only bind anonymously to this ldap. This...
7
by: Amar | last post by:
I am trying to connect to my college LDAP directory using ASP.NET. This LDap does not have security as it returns only user demographic information. i do not need to bind with a username or...
3
by: Jay | last post by:
I have a simple LDAP query (grabs all users from a particular AD group and populates a checkboxlist) that works perfectly fine on the development machine logged on locally as any user. When I...
2
by: Neil via .NET 247 | last post by:
I have some code vb.net winforms, that works fine most of the time but stops working occasionally such as right now. The code is this Dim objDE As New DirectoryEntry("LDAP://" & DomainName) Dim...
3
by: mbasil77 | last post by:
I'm trying to port a piece of Java LDAP conneciton code to DOTNET. I've done LDAP in DOTNET before, but I keep getting a very strange message. The Java code looks like: public static boolean...
3
by: aydeejay | last post by:
I'm trying to troubleshoot an issue where users are not able to bind with LDAP via "GetObject" through our ASP Classic Intranet if they stay logged in overnight (beyond their allowed login hours). ...
3
by: eleland | last post by:
I am trying to bind to an LDAP server using php without success. I have a linux server running php compiled with open ldap. I am using the following code taken right from php.net: echo "<h3>LDAP...
1
by: sowing | last post by:
I am trying to bind to a LDAP server, but failed. Code as follow: #!/usr/bin/perl use strict; use warnings; use Net::LDAP; use Data::Dumper; use Net::LDAP::Util qw(ldap_error_name ...
6
by: hotani | last post by:
I am attempting to pull info from an LDAP server (Active Directory), but cannot specify an OU. In other words, I need to search users in all OU's, not a specific one. Here is what works: con...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.