I am using MediaWiki 1.28.0.
I want to provision new users (create new accounts) in MediaWiki using the API. The provisioning will be driven by a callout from another service (a registry that enrolls and manages users in a project using the wiki). Users do not participate directly in the provisioning.
$oauth = new OAuth( $consumerKey, $consumerSecret, OAUTH_SIG_METHOD_HMACSHA1,OAUTH_AUTH_TYPE_AUTHORIZATION );
$oauth->setToken( $accessToken, $accessSecret );
$response = json_decode($oauth->getLastResponse(), true);
When I execute that code the $response is, for example,
Array
(
[batchcomplete] =>
[query] => Array
(
[tokens] => Array
(
[createaccounttoken] => 8f9c1c7c2b38918cb5caac5c87dd2084585bf6c3+\
)
)
)
Note the end of the token include +\
First question: Is that form of the token, specifically having +\ at the end, correct and expected?
If I then take that token and execute
$createAccountToken = $response['query']['tokens']['createaccounttoken'];
I receive
Second question: What am I doing wrong when invoking the createaccount action?
I am following documentation at
but it is not clear to me which parts of that page may be deprecated and precisely how I should provision a new account.
I appreciate any insights.
Thanks,
Scott K