我在MediaWiki 1.28中使用MediaWiki API进行身份验证时遇到问题。
API:https://www.mediawiki.org/wiki/API:Main_page
我的确切尝试:https://github.com/tomasbjerre/git-changelog-lib/tree/feature/medawiki
我是如何做到的:
Authenticating to 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 could not be authenticated."}}
我正在使用这个组合来摆弄MediaWiki 1.28: https://github.com/pastakhov/compose-mediawiki-ubuntu
我创建了一个用于身份验证的bot用户。
使用维护脚本eval.php时:
root@9b3370557c92:/# cd /var/www/html/w/maintenance
root@9b3370557c92:/var/www/html/w/maintenance# php eval.php
拥有这样的机器人:
我得到的反应如下:
> echo BotPassword::login( "User@newbot", "odqp6am3aerd6pa4gikm17d87a4r26dh", RequestContext::getMain()->getRequest() )->getMessage()->getKey();
internalerror_info
如果我不使用User @前缀(忽略Mediawiki bot创建页面建议的内容)
> echo BotPassword::login( "newbot", "odqp6am3aerd6pa4gikm17d87a4r26dh", RequestContext::getMain()->getRequest() )->getMessage()->getKey();
botpasswords-invalid-name
The documentation这里很乱。我建议专门为1.28重写它,并为旧用户保留当前页面。
答案 0 :(得分:0)
ggplot(ellipse_df) +
geom_histogram(aes(theta)) +
coord_polar(start = pi/2, direction = -1)
应为lgname
。 (如果你还没有,你应该使用bot password。)