Sponsored Content
Top Forums Shell Programming and Scripting Using Wget with Digest Authentication Post 302662167 by mtarkowski on Tuesday 26th of June 2012 09:06:16 AM
Old 06-26-2012
Using Wget with Digest Authentication

I’m trying to use wget 1.13.4 from a command line to access a web page using Digest Authentication on a Tomcat server, 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 - <URL_here>
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--
<URL_here>
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.

Last edited by vbe; 06-26-2012 at 10:59 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Digest MD5

Dear Guys , Am sorry i ask alot , but i do not know that much about perl , cgi , MD5 ! now i installed MD5 and Digest MD5 to my solaries 7 sparc machine . when i execute the command : $perl Makefile.PL i get the follwoing error message ,, please tell me how to fix it , i need... (11 Replies)
Discussion started by: tamemi
11 Replies

2. Shell Programming and Scripting

Help with wget

Hi, i need temperature hourly from a web page Im using wget to get the web page. I would like to save the page downloaded in a file called page. I check the file everytime i run the wget function but its not saving but instead creates a wx.php file....Each time i run it...a new wx.php file is... (2 Replies)
Discussion started by: vadharah
2 Replies

3. Shell Programming and Scripting

wget

Hi I want to download some files using wget , and want to save in a specified directory. Is there any way to save it.Please suggest me. (1 Reply)
Discussion started by: mnmonu
1 Replies

4. UNIX for Dummies Questions & Answers

Different MD5 value when using 'digest' command

Hi guys, I need to anonymise some data; Some of it in an Oracle database and some in text files. I'm using the 'digest' command on Solaris 10 OS and an Oracle function to encode the data in the database. However, as a test, when i try to encode the same string in the dataabse ans OS, I get... (4 Replies)
Discussion started by: zaff
4 Replies

5. UNIX for Dummies Questions & Answers

Wget

...... (1 Reply)
Discussion started by: hoo
1 Replies

6. Shell Programming and Scripting

WGET help!

Hi Friends, I have an url like this https://www.unix.com/help/ In this help directory, I have more than 300 directories which contains file or files. So, the 300 directories are like this http://unix.com/help/ dir1 file1 dir2 file2 dir3 file3_1 file3_2... (4 Replies)
Discussion started by: jacobs.smith
4 Replies

7. Red Hat

Wget

If I run the following command wget -r --no-parent --reject "index.html*" 10.11.12.13/backups/ A local directory named 10.11.12.13/backups with the content of web site data is created. What I want to do is have the data placed in a local directory called $HOME/backups. Thanks for... (1 Reply)
Discussion started by: popeye
1 Replies

8. Red Hat

Digest::md5 needed for RHEL 6.4

Hey, I've got a package that requires 'Digest:md5' to be installed but I can't locate a source for it from Redhat. Poking around on the internet I found some stuff that seemed to be for RHEL 6.4 but when I had yum try a local install it gives me this error. Transaction Check Error: file... (3 Replies)
Discussion started by: DustinT
3 Replies

9. Shell Programming and Scripting

Wget and gz

Can wget be used to goto a site and piped into a .gz extrated command? wget ftp://ftp.ncbi.nlm.nih.gov/pub/clinvar/vcf_GRCh37 | gunzip -d clinvar_20150603.vcf.gz (1 Reply)
Discussion started by: cmccabe
1 Replies

10. Shell Programming and Scripting

Wget - working in browser but cannot download from wget

Hi, I need to download a zip file from my the below US govt link. https://www.sam.gov/SAMPortal/extractfiledownload?role=WW&version=SAM&filename=SAM_PUBLIC_MONTHLY_20160207.ZIP I only have wget utility installed on the server. When I use the below command, I am getting error 403... (2 Replies)
Discussion started by: Prasannag87
2 Replies
All times are GMT -4. The time now is 11:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy