cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Basic auth and 401 (Re: Fwd: curl-library Digest, Vol 110, Issue 19)

From: Chris Johnson <cxjohnson_at_gmail.com>
Date: Thu, 9 Oct 2014 10:00:45 -0500

On Thu, Oct 9, 2014 at 9:21 AM, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Wed, 8 Oct 2014, Chris Johnson wrote:
>
> Please switch off the digest-mode of mail delivery if you want to
> participate in discussions on the list.
>

​Have done so. Sorry about that. Gmail client really makes dealing with
lists like this one difficult.
​

> I am able to connect to this server using the SoapUI tool, and can see
>> that it sends the entire POST twice, the initial time and then again in
>> response to the 401 / WWW-Authenticate response.
>>
>
> Then it probably didn't include the auth headers in the first request and
> only sent it again since the first request was rejected (and a 401 was sent
> back).
>
> You can make libcurl do that (in this case) unnecessary request as well if
> you really want to (by ORing CURLAUTH_ONLY to CURLAUTH_BASIC).
>
> But if you check SoapUI's request and compare its Basic auth header with
> the one libcurl sends, do they look the same? If you base64 decode the one
> SoapUI uses you can see exactly which user+password it sends...

​Actually, SoapUI sends the exact same headers and POST data twice,
including the base64 string in the auth header. Maybe it's just adhering
to Postel's law of being liberal in what it accepts. :-)

In the meantime, I've gotten it to work by changing my call from
CURLAUTH_BASIC to CURLAUTH_ANY, despite having been told by the supporting
organization for the server in question that they were using HTTP Basic
Auth. Except possibly for the cookies which I haven't bothered to
research, it certainly looks like Basic Auth to me.

I'm at the point where I'm convinced that the server is non-compliant and
I'm just using whatever works.

Thanks much for the help and clarifications of How Things Work (or are
Supposed To Work)!

..chris​

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-10-09