Perl Mechanize with NTLM authentication?

312 views
Skip to first unread message

Mark Kennedy

unread,
Sep 4, 2013, 3:35:21 PM9/4/13
to www-mecha...@googlegroups.com
I've searched endlessly on the web for how to do NTLM authentication wtih WWW::Mechanize for Perl

The following gives a GET error:



$mech = WWW::Mechanize->new('keepalive' => 1);
my $user = 'domain/username';
my $pass = 'password';

$mech->credentials(user, pass);


$mech ->get($url); <---------- //ERROR; Requires NTLM authorization

Daniel de Oliveira Mantovani

unread,
Sep 4, 2013, 5:48:42 PM9/4/13
to www-mecha...@googlegroups.com
use WWW::Mechanize;
my $mech = WWW::Mechanize->new(keep_alive => 1);
$mech->credentials('www.company.com:80', '', "MyDomain\\MyUserCode",
'MyPassword');
$mech->get("http://foo.com.br");

Maybe because "keepalive" doesn't exist ? Or because you are using
credentials in the wrong way ? Thy the code above.
> --
> You received this message because you are subscribed to the Google Groups
> "WWW::Mechanize users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to www-mechanize-u...@googlegroups.com.
> To post to this group, send email to www-mecha...@googlegroups.com.
> Visit this group at http://groups.google.com/group/www-mechanize-users.
> For more options, visit https://groups.google.com/groups/opt_out.



--

-dom

--

Daniel de Oliveira Mantovani
Business Analytic Specialist
Perl Evangelist /Astrophysics hobbyist.
+55 11 9 8538-9897
XOXO
Reply all
Reply to author
Forward
0 new messages