cURL / Mailing Lists / curl-library / Single Mail

curl-library

Help with basic auth problem?

From: Chris Johnson <cxjohnson_at_gmail.com>
Date: Tue, 7 Oct 2014 15:15:31 -0500

​My code's attempts to connect to server are failing with my authentication
rejected, but I know it's correct as I can connect with other tools.​ I
believe I've got my various CURLOPTs set correctly, and the exchange looks
right until it just goes off the rails. From my logs, I see (MD5 has been
trashed for privacy) that I send:

POST /EVSEligibilityWebService/spring-ws/EVSEligibility HTTP/1.1
Authorization: Basic XXkXXTk5NzYwXXXXXXXcnZlcjXXXXXXXXXXXXX==
Host: mn-its-atst.dhs.state.mn.us
Accept: */*
Content-Type: text/plain; charset=utf-8
Content-Length: 1055
Expect: 100-continue

The response is (timestamped lines from my libcurl debug callback logging
additional info):

HTTP/1.1 401 Unauthorized
Server: Sun-ONE-Web-Server/6.1
Date: Tue, 07 Oct 2014 19:44:47 GMT
Set-Cookie: ObSSOCookie=loggedoutcontinue; path=/; domain=.dhs.state.mn.us;
Set-Cookie: OBBasicAuth=fromDialog; path=/;

2014-10-07 14:44:47 ## Authentication problem. Ignoring this.

WWW-authenticate: Basic realm="LDAP UserName/Password"
Set-cookie: OBBasicAuth=fromDialog; path=/;

2014-10-07 14:44:47 Data:
<HTML><HEAD><TITLE>Unauthorized</TITLE></HEAD><BODY><H1>Unauthorized</H1>
Proper authorization is required for this area. Either your browser does
not perform authorization, or your authorization has failed.
</BODY></HTML>

2014-10-07 14:44:48 ## Done waiting for 100-continue

Shouldn't libcurl respond to the WWW-authenticate: header by resending the
Authorization: header again? Is the server wrong to send that and follow
it with an HTML page? Am I maybe not seeing the entire picture in the
logging from my debug callback?

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