Jump to content

Recommended Posts

Posted

Does anyone know how to connect to a server using HTTP Digest Authentication using PHP and without using Curl? The version of Curl currently installed on the server I am on (server 39) is 7.10.5, and HTTP Digest Authentication was not added to Curl until version 7.10.6, and the latest version is 7.10.8. I'm not sure if there are any planned upgrades to the servers anytime soon, but I need to be able to do this asap. Some help would be appreciated. Thanks!

 

Jeff Kieke

  • 2 weeks later...
Posted

Looks like I'll have to wait it out. I've been searching around for ways to do this without curl and I'm coming up totally empty. The only things I've found are scripts like this: http://www.xiven.com/sourcecode/digestauthentication

 

But that is something that goes on the server I am connecting to, not the other way around.

 

FWIW, this is the code I am using:

 

><?
$url = "http://some.url.com";
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERPWD, "username:password");
$result = curl_exec($ch);
curl_close($ch);
echo $result;
?>

 

I've also tried using the following, but this is what requires the newer version of Curl:

><?
$return = `/usr/bin/curl -u username:password http://some.url.com --digest`;
echo $return;
?>

 

I just can't seem to find anything using PHP that doesn't require Curl. The company I am trying to connect to has never had anyone use PHP to connect before. They have examples using Java, but I know nothing about Java or if it's installed on the server or anything.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...