cURL / Mailing Lists / curl-users / Single Mail

curl-users

Authentication problem? - Error 401

From: d w <dpwork_at_hotmail.com>
Date: Mon, 08 May 2006 14:11:12 -0700

I am using curl at client sites to monitor the process of scripts that run
every night. I have run into an issue with one of the clients that is
causing me great grief. I use two commands to post information to the same
server but different asp pages. I can get one of the commands to post
succesfully but not the other.

The first command is:

curl -u username:password -d "system=$COMPUTERNAME&xdate=`DATE -u
+%D`&xtime=`DATE -u +%R`&btnInput=submit"
http://server-ip/intell_project/_main/capture_time.asp

This one works fine and I can see the results.

The second command is:

curl -u username:password -d
"system=mycomputer&extract=Pending&upload=Pending&posting=Pending&startDate=`DATE
-u +%D`&startTime=`DATE -u +%R`&btnInput=submit"
http://server-ip/intell_project/_main/capture.asp

When the second command is run, it returns a 401 error. Here is the results
of a trace of this command:

== Info: About to connect() to server-ip port 80
== Info: Trying server-ip... == Info: connected
== Info: Connected to server-ip (server-ip) port 80
== Info: Server auth using Basic with user 'username'
=> Send header, 403 bytes (0x193)
POST /intell_pro ject/_main/captu re.asp HTTP/1.1..
Authorization: Basic ZG1hZG1pbj pkbTMwMzA=..
User -Agent: curl/7.1 5.0 (i586-pc-min gw32msvc) libcur l/7.15.0 OpenSSL
/0.9.7e zlib/1.2 .2..
Host: server -ip..
Accep t: */*..
Content- Length: 115..
Content-Type: application/x-www-form-urlencoded..
..
system=mycomputer&extract=Pending&upload=Pending&posting=Pending&startDate=05/08/06&startTime=20:12&btnInput=sub
mit
<= Recv header, 27 bytes (0x1b)
HTTP/1.1 401 Unauthorized..
<= Recv header, 24 bytes (0x18)
Connection: Keep-Alive..
<= Recv header, 22 bytes (0x16)
Content-Length:1656..
<= Recv header, 25 bytes (0x19)
Content-Type: text/html..
<= Recv header, 27 bytes (0x1b)
Server: Microsoft-IIS/6.0..
== Info: Authentication problem. Ignoring this.
<= Recv header, 49 bytes (0x31)
WWW-Authenticate: Basic realm="server-ip"..
<= Recv header, 23 bytes (0x17)
X-Powered-By: ASP.NET..
<= Recv header, 37 bytes (0x25)
Date: Mon, 08 May 2006 20:11:58GMT..
<= Recv header, 39 bytes (0x27)
Set-Cookie: BCSI-CS0A2A0302=1; Path=/..
<= Recv header, 94 bytes (0x5e)
Set-Cookie:
CF0A2A0302=D25AC79C!RE9NQUlOMVxETUFETUlOOm1vZm86EX8cnYjeyfJBbdmGL8k5Jw==;
Path=/..
<= Recv header, 33 bytes (0x21)
Cache-Control: proxy-revalidate..
<= Recv data, 1656 bytes (0x678)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/st
rict.dtd">
<HTML><HEAD><TITLE>You are not authorized to view this page</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
<STYLE type="text/css">
  BODY { font: 8pt/12pt verdana }
  H1 { font: 13pt/15pt verdana }
  H2 { font: 8pt/12pt verdana }
  A:link { color: red }
  A:visited { color: maroon }
</STYLE>
</HEAD><BODY><TABLE width=500 border=0 cellspacing=10><TR><TD>

<h1>You are not authorized to view this page</h1>
You do not have permission to view this directory or page using the
credentials
that you supplied because your Web browser is sending a WWW-Authenticate
header
field that the Web server is not configured to accept.
<hr>
<p>Please try the following:</p>
<ul>
<li>Contact the Web site administrator if you believe you should be able to
view
this directory or page.</li>
<li>Click the Refresh button to
try a
gain with different credentials.</li>
</ul>
<h2>HTTP Error 401.2 - Unauthorized: Access is denied due to server
configuratio
n.<br>Internet Information Services (IIS)</h2>
<hr>
<p>Technical Information (for support personnel)</p>
<ul>
<li>Go to <a href="http://go.microsoft.com/fwlink/?linkid=8180">Microsoft
Produc
t Support Services</a> and perform a title search for the words <b>HTTP</b>
and
<b>401</b>.</li>
<li>Open <b>IIS Help</b>, which is accessible in IIS Manager (inetmgr),
and search for topics titled <b>About Security</b>, <b>Authentication</b>,
and
<b>About Custom Error Messages</b>.</li>
</ul>

</TD></TR></TABLE></BODY></HTML>
== Info: Connection #0 to host server-ip left intact
== Info: Closing connection #0

Any suggestiions as to what I may be doing wrong would be greatly
appreciated. These same commands work for 20+ other clients. I'm going bald
trying to figure this one out.

Thanks!
Dennis

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
Received on 2006-05-08