I added your suggestion and got some extra debug printout but I don't know what it all means.

Do I need to include some "special" headers or ...?

For our security purposes, actual urls, domain names,username, and password are represented by generic strings enclosed with arrows.

#!/usr/bin/perl -w # test_NTLM-9.pl # use strict; use LWP::UserAgent; use LWP::Debug qw(+); my $page = ""; my $response = ""; my $ua = ""; my $j = ""; my %reports = (); my @headers = (); my $url1 = "http://<some url>/reports.asp"; my $url2 = "http://<some url>.<some domain>.com:80/reports.asp"; { package RequestAgent; our @ISA = qw(LWP::UserAgent); sub get_basic_credentials { return ("<DOMAIN\\username>", "<passowrd>"); } } $ua = RequestAgent -> new (keep_alive => 1); $response = $ua -> post ($url2, \%reports, ['report' => 'E911 Numbers' +]); @headers = $response -> header_field_names(); foreach $j (@headers) { print ("$j = ",$response -> header($j),"\n"); +} if ($response -> is_success) { print ("\nGOOD\n"); $page = $response -> code; } else { print ("\nBAD\n"); $page = $response -> code; } if (defined ($page)) { $page =~ s/<br>/\\\n/g; print ($page); } exit; C:\>test_NTLM-9.pl LWP::UserAgent::new: () LWP::UserAgent::request: () LWP::UserAgent::send_request: POST http://<some domain>.com:80/reports +. asp LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::Protocol::collect: read 811 bytes LWP::Protocol::collect: read 3620 bytes LWP::UserAgent::request: Simple response: Unauthorized Connection = close Date = Wed, 21 Mar 2007 11:55:29 GMT Server = Microsoft-IIS/5.0 WWW-Authenticate = NegotiateNTLM Content-Length = 4431 Content-Type = text/htmltext-html; charset=Windows-1252 Client-Date = Wed, 21 Mar 2007 11:55:04 GMT Client-Peer = 10.5.15.3:80 Client-Response-Num = 1 Client-Warning = Unsupported authentication scheme 'ntlm' Title = You are not authorized to view this page X-Meta-ROBOTS = NOINDEX BAD 401 C:\>

In reply to Re^6: LWP::UserAgent Authentication by palladinob
in thread LWP::UserAgent Authentication by palladinob

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.