Getting documents that are protected by basic auth

Aaron Turner (aturner@linuxkb.org)
Sat, 29 Jan 2000 00:38:44 -0800 (PST)


I'm going nuts.  I've read all the online docs, and found some books, but
for the life of me I can't get a password protected doc.  I put a sniffer
on the link, and found that the script isn't even sending the auth info to
the server at all.  Here's the code which tries to print out the page:

#!/usr/bin/perl
use LWP::UserAgent;
use HTTP::Request; 
use HTTP::Response;
use strict;
my $passwd = 'myname';
my $uname = 'mypass';
my $domain = 'My Realm Name';
my $agent = 'linuxkb-modperl';
my $url = 'http://devel.linuxkb.org/todo.html';

my $ua = LWP::UserAgent->new();
$ua->agent($agent);
$ua->credentials($url, $domain, $uname, $passwd);

my $request = HTTP::Request->new(GET => $url);
$request->referer("http://localhost/");

my $response = $ua->request($request);
print $response->content;

What is wrong???  Why will it send the referrer and agent info, but not
the http-auth info?  

--
Aaron Turner, Core Developer       http://vodka.linuxkb.org/~aturner/
Linux Knowledge Base Organization  http://www.linuxkb.org/
Because world domination requires quality open documentation.
aka: aturner@vicinity.com, aturner@pobox.com, ion_beam_head@ashtech.net
The difference between `Unstable' and `Usable' is only two characters: NT