NAME
Authen::NTLM - An NTLM authentication module
SYNOPSIS
use Mail::IMAPClient;use Authen::NTLM;my $imap = Mail::IMAPClient->new(Server=>'imaphost');ntlm_user($username);ntlm_password($password);$imap->authenticate("NTLM", Authen::NTLM::ntlm);:$imap->logout;ntlm_reset;:
or
ntlmv2(1);ntlm_user($username);ntlm_host($host);ntlm_password($password);:
or
my $ntlm = Authen::NTLM-> new(host => $host,user => $username,domain => $domain,password => $password,version => 1,);$ntlm-> challenge;:$ntlm-> challenge($challenge);
DESCRIPTION
This module provides methods to use NTLM authentication. It canbe used as an authenticate method with the Mail::IMAPClient moduleto perform the challenge/response mechanism for NTLM connectionsor it can be used on its own for NTLM authentication with otherprotocols (eg. HTTP).The implementation is a direct port of the code from F<fetchmail>which, itself, has based its NTLM implementation on F<samba>. Assuch, this code is not especially efficient, however it will stilltake a fraction of a second to negotiate a login on a PII which islikely to be good enough for most situations.
FUNCTIONS
- ntlm_domain()
-
Set the domain to use in the NTLM authentication messages.Returns the new domain. Without an argument, this functionreturns the current domain entry.
- ntlm_user()
-
Set the username to use in the NTLM authentication messages.Returns the new username. Without an argument, this functionreturns the current username entry.
- ntlm_password()
-
Set the password to use in the NTLM authentication messages.Returns the new password. Without an argument, this functionreturns the current password entry.
- ntlm_reset()
-
Resets the NTLM challenge/response state machine so that the nextcall to C<ntlm()> will produce an initial connect message.
- ntlm()
-
Generate a reply to a challenge. The NTLM protocol involves aninitial empty challenge from the server requiring a messageresponse containing the username and domain (which may be empty).The first call to C<ntlm()> generates this first message ignoringany arguments.The second time it is called, it is assumed that the argument isthe challenge string sent from the server. This will contain 8bytes of data which are used in the DES functions to generate theresponse authentication strings. The result of the call is thefinal authentication string.If C<ntlm_reset()> is called, then the next call to C<ntlm()> willstart the process again allowing multiple authentications withinan application.
- ntlmv2()
-
Use NTLM v2 authentication.
OBJECT API
- new %options
-
Creates an object that accepts the following options:
"user","host","domain","password","version".
- challenge [$challenge]
-
If
$challengeis not supplied, first-stage challenge string is generated. Otherwise, the third-stage challenge is generated, where$challengeis assumed to be extracted from the second stage of NTLM exchange. The result of the call is the final authentication string.
AUTHOR
David (Buzz) Bussenschutt <[email protected]> - current maintainerDmitry Karasik <[email protected]> - nice ntlmv2 patch, OO extensions.Andrew Hobson <[email protected]> - initial ntlmv2 codeMark Bush <[email protected]> - perl portEric S. Raymond - author of fetchmailAndrew Tridgell and Jeremy Allison for SMB/Netbios code
SEE ALSO
perl, Mail::IMAPClient, LWP::Authen::Ntlm
HISTORY
1.09 - fix CPAN ticket # 707031.08 - fix CPAN ticket # 399251.07 - not publicly released1.06 - relicense as GPL+ or Artistic1.05 - add OO interface by Dmitry Karasik1.04 - implementation of NTLMv2 by Andrew Hobson/Dmitry Karasik1.03 - fixes long-standing 1 line bug L<http://rt.cpan.org/Public/Bug/Display.html?id=9521> - released by David Bussenschutt 9th Aug 20071.02 - released by Mark Bush 29th Oct 2001