LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

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

Rep: Reputation: 0
Perl NTLM authenticating module


Hi,
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
http://search.cpan.org/~gaas/libwww-...lm.pm#SYNOPSIS
to work, but it simply won't.

Code:
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, 05:09 PM   #2
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
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 http://cpansearch.perl.org/src/GAAS/...Authen/Ntlm.pm and add diagnostic prints.
 
  


Reply


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 09:15 AM
Perl with LWP and NTLM wondergirl Programming 3 05-22-2010 03:32 PM
list perl module & install perl module DBD::mysql linson_85 Linux - Newbie 4 06-22-2009 11:42 AM
Perl module Compress::Zlib installed but perl not detecting it danran Programming 0 05-03-2007 02: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 06:37 PM


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

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