Skip Menu |

This queue is for tickets about the WWW-Mediawiki-Client CPAN distribution.

Report information
The Basics
Id: 20259
Status: open
Priority: 0/
Queue: WWW-Mediawiki-Client

People
Owner: Nobody in particular
Requestors: jom [...] de.uu.net
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.31
Fixed in: (no value)



Subject: authentication against webserver using mvs
Hello mvs developers, Is there any chance make mvs capable of supporting webserver authentication? We run a wiki on a password protected https server. Found out that https works with -T switch but it looks like authentication with username and password is not possible (or do i miss something?) I think it would be a nice idea to include support for Net::Netrc. I am not a perl hacker but i guess it's just adding a few lines to WWW/Mediawiki/Client.pm : First look up username and password for that host specified by -d and then pass that to LWP::UserAgent ?! Could you include this feature in a next release of mvs ? I would love you for doing so! Best Regards, Jodok
Here is some code to use LWP::Useragent with Net::Netrc and https. I do not know how to inlcude that into mvs but it is perhaps helpfull for the developers: #!/local/bin/perl -w $| = 1; use strict; # $ENV{HTTPS_VERSION} = '3'; use LWP::UserAgent; use Net::Netrc; my $ua = LWP::UserAgent->new; $ua->agent("MyApp/0.1 "); my $proto = "https"; my $port = 443; my $server = "myhost.somedomain.tld"; my $page = "/path/to/index.html"; my $netrc = Net::Netrc->lookup($server); my $realm = 'Protected Area'; my $login = $netrc->login; my $passwd = $netrc->password; $ua->credentials ($server . ':' . $port, $realm, $login, $passwd); my $req = HTTP::Request->new (GET => $proto . '://' . $server . $page); $req->content_type ('application/x-www-form-urlencoded'); my $res = $ua->request ($req); print $res->code, "\n"; print $res->content; unless ($res->is_success) { print "Bad luck this time\n"; } /# cat ~/.netrc machine myhost.somedomain.tld login foobar@somecompany.tld password S3cretstr1nG have fun