Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 11-10-2010, 06:29 AM   #1
LQ Newbie
Registered: Nov 2010
Posts: 2

Rep: Reputation: 0
Perl NTLM authenticating module

I'm trying to write a script in Perl to download a file that requires NTLM authentication to access, stored on a machine on this network.

I'm trying to get this
to work, but it simply won't.

use LWP::UserAgent;
use HTTP::Request::Common;

my $url = 'http://machine:port/file.pdf';
# Set up the ntlm client and then the base64 encoded ntlm handshake message
my $ua = LWP::UserAgent->new(keep_alive=>1);
$ua->credentials('http://machine:port/', '', 'machine\\username', 'userpass');
my $request = new HTTP::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"}
Any suggestions as to how I'd go about debugging this?
The file exists, and can be accessed through a web-browser, btw.
Old 11-11-2010, 04:09 PM   #2
Sergei Steshenko
Senior Member
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Look into the logs of 'machine' - I think (at ;east it's the way things are under Linux) system logs (I vaguely remember Windows has security logs or events).


Also look into and add diagnostic prints.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
perl authenticate ntlm ? cs24 Programming 8 06-12-2010 08:15 AM
Perl with LWP and NTLM wondergirl Programming 3 05-22-2010 02:32 PM
list perl module & install perl module DBD::mysql linson_85 Linux - Newbie 4 06-22-2009 10:42 AM
Perl module Compress::Zlib installed but perl not detecting it danran Programming 0 05-03-2007 01:50 PM
Problem with perl module for w3c validator to work on my local Apache+PHP+perl instal tbamt Linux - Software 0 12-16-2004 05:37 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:04 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration