Closed MikaMaracuja closed 4 years ago
MediaWiki Version is 1.28.0
the auth code has changed quite a lot in the latest releases of wikibase-edit, and thus of wikibase-cli, did it solve your problem by any chance?
otherwise, I have been using/testing wikibase-edit/cli on MediaWiki >= 1.33
, but I have little knowledge on what has change between MediaWiki releases, so no clue on if that could be an issue
Closing for now: if that's still an issue with the latest version, please reopen with updated info
We have a local instance of wikibase and have upgraded wikibase-cli to the latest version V9.2.1. Since then, neigher Oauth token authentication nor password authentication works for the wikibase-cli edit commands.
for example:
but
<path>/.nvm/versions/node/v8.2.1/lib/node_modules/wikibase-cli/bin> wb add-claim Q4227 P20 Q49 This operation requires to set your crendentials for http://<hostname>:<portnumber> Which authentication mechanism would you like to use to login to http://<hostname>:<portnumber> ?: /!\ Beware that those will be stored in plain text on your computer
1 - OAuth tokens (recommended) 2 - username - passwordwhere method 1 results in "Nonce already used error" and method 2 results in "invalid csrf token"
additional side note: our wikimedia installation does not follow the url schema
https?://{lang}.{wiki}.{tld}/w/api.php
, buthttp://{hostname}:{port}/api.php
Details on Method 1
First question:
For the Oauth registration, do you change the wpname for each myusername?
http://<hostname>:<portnumber>/wiki/Special:OAuthConsumerRegistration/propose?wpname=wikibase-cli-myusername&wpdescription=tokens%20for%20wikibase-cli%20%28https%3A%2F%2Fgithub.com%2Fmaxlath%2Fwikibase-cli%29&wpownerOnly=1
e.g. wikibase-cli-maxlath or do you keep the value: wikibase-cli-myusername?
debug output
I have used a python testscript mwtest.py for the Oauth method and spooled the debug information:
this results in
Details on Method 2
I have added some debug output, as far as I could understand and change the code:
debug output
Did you notice, the parsedURL does include the port number in the hostname?
"host":"<hostname>:<portnumber>","port":"<portnumber>"
config.json
Summary
I do not think this is really an error inside of wikibase-cli, but I am a little bit stuck in the problem, and could need a hint. Did you solve similar problems already?