mercredi 3 septembre 2014

PHP Acessing remote script with directory authentication


Vote count:

0




i'm trying to access a remote script using curl.


Normally is not a problem, just do curl_init, set some option and do curl_exec. Simple enough.


Now some complication.


The remote script is an ASP script placed in a folder protected by http authentication under Microsoft IIS.


My script is a PHP script free for all under apache.


After tre days of tests the problem is clearly the authentication.


What i tryed already is to puth authentication in the host like



http://ift.tt/1qnI9B3


and also



$user_pass = $_SESSION['user'] . ":" . $_SESSION['pass'];
curl_setopt ($curlSession, CURLOPT_USERPWD, $user_pass );
curl_setopt ($curlSession, CURLOPT_HTTPAUTH, CURLAUTH_ANY );


i use to store user and password in session becuase someone told me to resend credential each call once login happen.


what i get in response from curl?



401 Unauthorized... and the script i'm looking for.


The problem is that browser think i cannot access and prompt me for user and password again


There is some other way to pass credential? is this a problem from IIS behavior?


Any other idea?


Any help will be appreciated


regards



asked 1 min ago

Alex75

171






PHP Acessing remote script with directory authentication

Aucun commentaire:

Enregistrer un commentaire