iThunder has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks
I am trying to use following code (from CPAN website) to do NTLM authentication with perl but its not working.
#!/usr/bin/perl use LWP::UserAgent; use HTTP::Request::Common; use LWP::Debug qw(+); use Authen::NTLM; use strict; use warnings; ntlmv2(1); my $url = 'http://192.168.1.27/index.html'; # Set up the ntlm client and then the base64 encoded ntlm handshake me +ssage my $ua = LWP::UserAgent->new(keep_alive=>1); my $host = '192.168.1.27:80'; my $uname = 'test.com\User1'; my $psswd = 'test1234'; $ua->credentials('192.168.1.27:80', '', "$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"
Looking at the packet capture, i see that ???? sent as domain rather test.com. Is there something i am doing wrong?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: wrong domain name when using LWP::Authen::Ntlm
by kcott (Archbishop) on Dec 19, 2016 at 05:16 UTC | |
by iThunder (Beadle) on Dec 19, 2016 at 06:16 UTC | |
|
Re: wrong domain name when using LWP::Authen::Ntlm
by huck (Prior) on Dec 19, 2016 at 02:18 UTC | |
by iThunder (Beadle) on Dec 19, 2016 at 02:29 UTC | |
|
Re: wrong domain name when using LWP::Authen::Ntlm
by xytras78 (Initiate) on Feb 28, 2017 at 20:48 UTC |