I have a Perl Script which works when Basic Authentication is used but gives Http Error 401 after the IIS Authentication Method is changed to "Integrated Windows Authentication" on Windows 2000.
The script is:
# non-buffered output to server
$|=1;
use LWP::UserAgent;
use URI::URL;
local $ua = LWP::UserAgent->new;
$ua->timeout(20); # set our BASIS WEBserver timeout to 20 seconds
$myoutput = "";
$item = 1;
do {
local $req =
HTTP::Request->new(GET => "
http://nztva$dbmv"."DDW?W
=$url\&m=$
item\&R=Y\
&U=1\n\n")
;
$req->authorization_basic(
"b","c"); # uid and password for authorized WWW sources
$res =$ua->request($req);
$myoutput = $myoutput . $res->content;
$item++;
} while ($item <= $tmem); # end do
$myoutput =~ s/\r/\r~/g;
print "Content-type: text/html\n";
print "Content-Length: " . length($myoutput) . "\n\n";
$myoutput =~ s/\r~/\r/g;
print $myoutput;
}
exit;
This script concatenantes a series of web pages into 1 page for display. I get a series of 401 authentication errors instead of the data:
HTTP Error 401
401.2 Unauthorized: Logon Failed due to server configuration
How do I need to change the line:
$req->authorization_basic(
"b","c"); # uid and password for authorized WWW sources
To allow access when using Integrated Windows Authentication on Windows 2000 and Windows NT Challenge/Response on Windows NT?
I'm sure it's easy to do but I don't know how!
Thanks for your Help.
Start Free Trial