curl-and-php
ASPX Active Directory Authentication Help - Followup
Date: Fri, 23 Jul 2004 14:23:13 -0400
Hi All,
A week or so ago, I posted a request for help with a problem that I was
having with ASPX authentication. Thanks to those who responded. Some
misunderstood what I was trying to do, so I will try to be more clear
from now on. My situation is that I have a php application that is
directly communicating with an ASPX application on another server. All
communication is handled using libcurl. The basic sequence, without all
of the gory details, is:
1) 'get' login page
2) 'post' login page (with userid, passwd, etc) and follow to
'home' page.
3) 'get' request page
4) 'post' request page with request parameters (1 or more times)
5) 'get' results page
6) logout by 'getting' login page...
I did solve the problem, through some trial and error (many errors...)
and I wanted to relate what I have discovered. The ASPX application
with which I was trying to communicate, passed back an authentication
cookie as the result of successfully posting the login page. I was
never able to get libcurl to automagically handle passing that cookie
back as part of the next 'get' no matter what combination and
configuration of curl options that I used. So, I resorted the more
brute-force method of manually placing the cookie information into the
'get' header using
curl_setopt($ch, CURLOPT_HTTPHEADER, $hdroptarray);
where $hdroptarray = array("Cookie: adAuthCookie=".$cookie_val);
This method works very well so I am content. Thanks and good luck to
all.
Ron
Received on 2004-07-23