I'm trying to use wget 1.13.4 from a command line to access a web page using Digest Authentication and I keep getting HTTP/1.1 401 Unauthorized response. Below is my code and the response. Any suggestions would be appreciated.
wget --debug --server-response --user-agent="" --ignore-case --user=admin --password=abc -O - http://10.107.70.21:8080/admin/console/View.jsp Setting --server-response (serverresponse) to 1 Setting --user-agent (useragent) to Setting --ignore-case (ignorecase) to 1 Setting --user (user) to admin Setting --password (password) to abc Setting --output-document (outputdocument) to - DEBUG output created by Wget 1.13.4 on linux-gnu. --2012-06-26 07:58:14-- http://10.107.70.21:8080/admin/console/View.jsp Host `10.107.70.21' has not issued a general basic challenge. Connecting to 10.107.70.21:8080... connected. Created socket 3. Releasing 0x000000001174a680 (new refcount 0). Deleting unused 0x000000001174a680. ---request begin--- GET /admin/console/View.jsp HTTP/1.1 Accept: */* Host: 10.107.70.21:8080 Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.1 401 Unauthorized Server: Apache-Coyote/1.1 Pragma: No-cache Cache-Control: no-cache Expires: Wed, 31 Dec 1969 19:00:00 EST WWW-Authenticate: Digest realm="Admin Console", qop="auth", nonce="c53281ac78f4ad7dcf903d29372db789", opaque="1340c4ba6a13a14 d0d0bcc6262d8ad83" Content-Type: text/html;charset=utf-8 Content-Length: 954 Date: Tue, 26 Jun 2012 11:58:14 GMT ---response end--- HTTP/1.1 401 Unauthorized Server: Apache-Coyote/1.1 Pragma: No-cache Cache-Control: no-cache Expires: Wed, 31 Dec 1969 19:00:00 EST WWW-Authenticate: Digest realm="Admin Console", qop="auth", nonce="c53281ac78f4ad7dcf903d29372db789", opaque="1340c4ba6a13a 14d0d0bcc6262d8ad83" Content-Type: text/html;charset=utf-8 Content-Length: 954 Date: Tue, 26 Jun 2012 11:58:14 GMT Registered socket 3 for persistent reuse. Skipping 954 bytes of body: [<html><head><title>Apache Tomcat/6.0.29 - Error report</title><style><!--H1 {font-family:Tahoma,Arial ,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-c olor:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY { font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;backgr ound-color:#525D76;} Skipping 442 bytes of body: [P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12 px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 401 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>This request requires HTT P authentication ().</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.29</h3></body></html>] done. Reusing existing connection to 10.107.70.21:8080. Reusing fd 3. ---request begin--- GET /admin/console/View.jsp HTTP/1.1 Accept: */* Host: 10.107.70.21:8080 Connection: Keep-Alive Authorization: Digest username="admin", realm="Admin Console", nonce="c53281ac78f4ad7dcf903d29372db789", uri="/admin/console/ View.jsp", response="7cd7f9b4271d4e2bfb18a112ab9a42d0", opaque="1340c4ba6a13a14d0d0bcc6262d8ad83" ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.1 401 Unauthorized Server: Apache-Coyote/1.1 Pragma: No-cache Cache-Control: no-cache Expires: Wed, 31 Dec 1969 19:00:00 EST WWW-Authenticate: Digest realm="Admin Console", qop="auth", nonce="b0da6404ba288764a129deb4b80b2f9e", opaque="62b6cc5282e54f6 da2b94814ded090f6" Content-Type: text/html;charset=utf-8 Content-Length: 954 Date: Tue, 26 Jun 2012 11:58:14 GMT ---response end--- HTTP/1.1 401 Unauthorized Server: Apache-Coyote/1.1 Pragma: No-cache Cache-Control: no-cache Expires: Wed, 31 Dec 1969 19:00:00 EST WWW-Authenticate: Digest realm="Admin Console", qop="auth", nonce="b0da6404ba288764a129deb4b80b2f9e", opaque="62b6cc5282e54 f6da2b94814ded090f6" Content-Type: text/html;charset=utf-8 Content-Length: 954 Date: Tue, 26 Jun 2012 11:58:14 GMT Skipping 954 bytes of body: [<html><head><title>Apache Tomcat/6.0.29 - Error report</title><style><!--H1 {font-family:Tahoma,Arial ,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-c olor:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY { font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;backgr ound-color:#525D76;} Skipping 442 bytes of body: [P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12 px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 401 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>This request requires HTT P authentication ().</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.29</h3></body></html>] done. Authorization failed. Regards, Michael Tarkowski Sales & Marketing Application Architecture Chrysler Group LLC Office: +01.248.838.4866 Mobile: +01.248.891.5097 Email: [email protected]<mailto:[email protected]> Mobile Text: [email protected]<mailto:[email protected]>
