I'm running into a VERY similar issue, though I am *not* specifying NTLMv2 as the original poster was doing. I'd really appreciate any pointers anyone could offer. I'm really at a loss here.

Using the original code above as a base, but fixing the syntax errors... In my code, I'm clearly setting a specific domain. 'mydom' -- however after looking at the WireShark capture, I can see the NTLM challenge back from the webserver with a Target Name of 'differentdomain'. The GET then sends back 'differentdomain\User1' instead of the specified 'mydom\User1'. Any thoughts???

#!/usr/bin/perl -w use LWP::UserAgent; use HTTP::Request::Common; use LWP::Debug qw(+); use Authen::NTLM; use strict; use warnings; my $url = 'http://mywebserver.com/Path/Path2/MyFile.htm'; # Set up the ntlm client and then the base64 encoded ntlm handshake me +ssage my $ua = LWP::UserAgent->new(keep_alive=>1); my $host = 'mywebserver.com:80'; my $uname = 'mydom\User1'; my $psswd = 'test1234'; $ua->credentials("$host", '', "$uname", "$psswd"); my $request = GET $url; print "--Performing request now...-----------\n"; my $response = $ua->request($request); print "--Done with request-------------------\n"; if ($response->is_success) {print "It worked!->" . $response->code . " +\n";} else {print "It didn't work!->" . $response->code . "\n"}

In reply to Re: wrong domain name when using LWP::Authen::Ntlm by xytras78
in thread wrong domain name when using LWP::Authen::Ntlm by iThunder

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.