Over the past 48 hours, there seems to have been a change in the behaviour of MediaWiki login API for Wikidata. This causes all logins from Wikidata-Toolkit (Java library) to fail. Among others, this affects OpenRefine users.
To reproduce:
* Fetch a login token with https://www.wikidata.org/w/api.php?action=query&meta=tokens&type=login&format=json
* Perform a POST query to login using this token and valid credentials:
```
curl -X POST "https://www.wikidata.org/w/api.php" -d "action=login&lgname=MY_USERNAME&lgpassword=MY_PASSWORD&lgtoken=MY_TOKEN&format=json"
```
which gives the following response:
```
{
"warnings": {
"main": {
"*": "Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes.he bug comes from the fact that Wikidata started returning cookies using a `set-cookie` header, Use [[Special:ApiFeatureUsage]] to see usage of deprecated features by your application."
},
"login": {
"*": "Fetching a token via \"action=login\" is deprecatedwhereas Wikidata-Toolkit expects `Set-Cookie`. Use \"action=query&meta=tokens&type=login\" instead."
}
},
"login": {
"result": "NeedToken",
"token": "dda68bc218a252765816dca9570ec6755e8d6462+\\"
}
}
```
This bug can be observed for existing releases of Wikidata-Toolkit (and therefore OpenRefine)HTTP header keys are case insensitive so Wikidata-Toolkit should recognize `set-cookie` as well, sobut as this issue cannot come from angs stand this breaks login in all client-side changes relying on this library. One can observe that no data imports have been made through OpenRefine for about 48 hours: https://tools.wmflabs.org/editgroups/?tool=ORSee [[https://github.com/Wikidata/Wikidata-Toolkit/pull/490|this pull request on Wikidata-Toolkit]] for details.
This seems to depend on subtle details of cookie handling according to [[https://github.com/Wikidata/Wikidata-Toolkit/pull/490|this pull request]].
While we can of course fix things on Wikidata-Toolkit's side, it would be great if the change on Wikidata's side could be reverted at least temporarily, since fixing this on our side requires making new releases of Wikidata-Toolkit and OpenRefine.
OR issue: https://github.com/OpenRefine/OpenRefine/issues/2526
WDTK issue: https://github.com/Wikidata/Wikidata-Toolkit/issues/491