Skip Menu |

This queue is for tickets about the MediaWiki-API CPAN distribution.

Report information
The Basics
Id: 106214
Status: resolved
Priority: 0/
Queue: MediaWiki-API

People
Owner: Nobody in particular
Requestors: richie765 [...] gmail.com
Cc:
AdminCc:

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



Subject: Error, NeedToken
Date: Sun, 02 Aug 2015 20:40:02 +0200
To: bug-MediaWiki-API [...] rt.cpan.org
From: Richard Faasen <richie765 [...] gmail.com>
I've upgraded MediaWiki to v1.25 and since then MediaWiki::API won't login with the error "NeedToken". I think the problem only happens over https. Something strange is happening with the cookies, I don't know what exactly, but the following hack seems to solve the problem, but it's probably not such a good fix, so I just include it here to highlight where the problem lies. Hopefully a real fix can be made. Search for "cookie_jar", replace with: use HTTP::Cookies; my $cookie_jar = HTTP::Cookies->new( file => "/tmp/lwp_cookies.dat", autosave => 1, ignore_discard => 1, ); $ua->cookie_jar($cookie_jar);
I think that, since 1.22, Mediawiki::API cannot login to Mediawiki sites anymore, as it needs a CSRF token. I have a working proof of concept login here: https://stackoverflow.com/a/47446018/1174784 ... inspired the Mediawiki::Bot code. I'll see if I can work on a patch.
Works ok here with the latest version.