Cannot authenticate with MediaWiki 1.28 API -
i'm having problems authenticating mediawiki api in mediawiki 1.28.
the api: https://www.mediawiki.org/wiki/api:main_page
my exact attempt: https://github.com/tomasbjerre/git-changelog-lib/tree/feature/medawiki
how i'm doing it:
authenticating http://localhost:8889/w posting to: http://localhost:8889/w/api.php?action=query&meta=tokens&format=json&type=login got cookie: mediawiki_session=pnbmq5t2cq8gsnv4cm74lb6f3aa5vbeb; path=/; httponly response: {"batchcomplete":"","query":{"tokens":{"logintoken":"bc18a93aedd4993634ddb8e28e6cd60259993ca3+\\"}}} using logintoken: bc18a93aedd4993634ddb8e28e6cd60259993ca3+\ posting to: http://localhost:8889/w/api.php?action=login&format=json using cookie: mediawiki_session=pnbmq5t2cq8gsnv4cm74lb6f3aa5vbeb; path=/; httponly post content: lgname=user%40botuser&lgpassword=*&lgtoken=bc18a93aedd4993634ddb8e28e6cd60259993ca3%2b%5c response: {"login":{"result":"failed","reason":"the supplied credentials not authenticated."}}
i using compose fiddle mediawiki 1.28: https://github.com/pastakhov/compose-mediawiki-ubuntu
i have created bot-user using authenticate.
when using maintenance script eval.php this:
root@9b3370557c92:/# cd /var/www/html/w/maintenance root@9b3370557c92:/var/www/html/w/maintenance# php eval.php
and having bot this:
i responses like:
> echo botpassword::login( "user@newbot", "odqp6am3aerd6pa4gikm17d87a4r26dh", requestcontext::getmain()->getrequest() )->getmessage()->getkey(); internalerror_info
and if dont prefix user@ (ignoring mediawiki bot creation page suggests)
> echo botpassword::login( "newbot", "odqp6am3aerd6pa4gikm17d87a4r26dh", requestcontext::getmain()->getrequest() )->getmessage()->getkey(); botpasswords-invalid-name
the documentation here mess. suggest rewriting exclusively 1.28 , keep current page legacy users.
lgname
should botuser
. (and if aren't yet, should using bot password.)
Comments
Post a Comment