LWP::Authen::Ntlm (3)
Leading comments
Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) Standard preamble: ========================================================================
NAME
LWP::Authen::Ntlm - Library for enabling NTLM authentication (Microsoft) in LWPSYNOPSIS
use LWP::UserAgent; use HTTP::Request::Common; my $url = 'www.company.com/protected_page.html'; # Set up the ntlm client and then the base64 encoded ntlm handshake message my $ua = LWP::UserAgent->new(keep_alive=>1); $ua->credentials('www.company.com:80', '', "MyDomain\\MyUserCode", 'MyPassword'); $request = GET $url; print "--Performing request now...-----------\n"; $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"}
DESCRIPTION
"LWP::Authen::Ntlm" allowsThe module takes advantage of the Authen::NTLM module by Mark Bush. Since there is also another Authen::NTLM module available from
In addition, there have been problems with incompatibilities between different versions of Mime::Base64, which Bush's Authen::NTLM makes use of. Therefore, it is necessary to ensure that your Mime::Base64 module supports exporting of the encode_base64 and decode_base64 functions.
USAGE
The module is used indirectly through- *
-
Enable persistent HTTPconnections
To do this, pass the ``keep_alive=>1'' option to the LWP::UserAgent when creating it, like this:
my $ua = LWP::UserAgent->new(keep_alive=>1);
- *
-
Set the credentials on the UserAgent object
The credentials must be set like this:
$ua->credentials('www.company.com:80', '', "MyDomain\\MyUserCode", 'MyPassword');
Note that you cannot use the HTTP::Request object's authorization_basic() method to set the credentials. Note, too, that the 'www.company.com:80' portion only sets credentials on the specified port
ANDit is case-sensitive (this is due to the wayLWPis coded, and has nothing to do with LWP::Authen::Ntlm)
AVAILABILITY
General queries regardingQuestions specific to LWP::Authen::Ntlm can be forwarded to jtillman@bigfoot.com