API:Account creation/ru

Вы можете создавать аккаунты, используя API. Это может быть как новым аккаунтом для вас, так и для кого-то другого, со случайно сгенерированным, сообщенным ему паролем. Создания аккаунтов записаны в Special:log/newusers. Если вы вошли в свой аккаунт, ваш логин будет записан при создании нового аккаунта.

Эта страница документирует API создания аккаунта для MediaWiki 1.27. Documentation of the API as it existed in earlier versions is available:

Создание аккаунта
Для создания аккаунта нужен токен, который может быть получен запросом.

Это действие реализует интерактивное создание аккаунта, которое может включать CAPTCHA, взаимодействие со сторонними сервисами, двухфакторную авторизацию и т.д. As such, the specific fields required may vary depending on the configuration of the wiki. A description of the fields needed should be fetched from the query.

Simple example
On a wiki without any special authentication extensions, the fields needed might include username, password , and retype , and optionally email and realname.

Creating an account for someone else
If you're creating an account for someone else, you'll also need to specify a reason. You might also use mailpassword in place of password and retype to have MediaWiki send the new user a temporary password via email.

A complex example
On the other hand, a wiki with a CAPTCHA extension, an extension for authentication using OpenID Connect, and a two-factor authentication extension might have a more complicated account creation process process.

The client would be expected to redirect the user's browser to the provided redirecttarget.

The OpenID provider would authenticate, and redirect to Special:OpenIDConnectReturn on the wiki, which would validate the OpenID response and then redirect to the createreturnurl provided in the first POST to the API with the code and state parameters added.

The client gets control of the process back at this point and makes its next API request.

Now the client would prompt the user to set up a new account in their two-factor authentication app and enter the current code, or allow the user to skip 2FA setup. Let's assume the user does set up 2FA.

The account creation has finally succeeded.

If at any point account creation fails, a response with status FAIL will be returned, along with a message to display to the user.

Disable
To disable specifically this API feature, insert the following line in your configuration file: