Authorization
Lana M. Soller (lana@scd.ucar.edu)
Wed, 17 Nov 1999 15:20:45 -0800 (PST)
Please help if you can.
I am stuck on the simple "send username password" part using UserAgent.
Here's what I've got...
#-----------------------------------------------------------------------
$ua = new LWP::UserAgent;
my($login) = "xxx";
my($passwd) = "xxxx";
my($netloc) = "www.dir.ucar.edu/rooms/admin";
my($realm) = "Reservation Administration";
my($path) = "http://www.dir.ucar.edu/rooms/admin/index.html";
$ua->credentials($netloc, $realm, $login, $passwd);
my $req = new HTTP::Request("GET", $path);
my $response = $ua->request($req);
print $response->as_string;
#----------------------------------------------------------------------
The authentication fails. I found a posting in the archives where it was
suggested to try $req->authorization_basic ("login","password"); however
my libwww UserAgent distribution does not appear to contain this method -
anywhere! (libwww-perl-5.46). I am open to any and all suggestions.
Thanks in advance!
Lana
------ Lana M. Stillwell-Soller Software Engineer
\ SCD/Infrastructure Support Group Office: 303-497-1244
*\ NCAR Fax: 303-497-1804
*// PO Box 3000 Mobile: 303-882-0213
--/-----Boulder, CO 80307-3000----------------------------------