Page MenuHomePhabricator

https://www.mediawiki.org/wiki/API:Account_creation confusing - examples and details missing
Open, Needs TriagePublic

Description

From MW 1.27 on there has been a design decision to change the Account creation API to make it more flexible.

As outlined in https://www.mediawiki.org/wiki/Topic:V8v99p6xookam0ig when using the API in "old style" an error message

Unrecognized parameters: mailpassword, reason, email, username, realname.

is returned which is not part of the https://www.mediawiki.org/wiki/API:Account_creation#Possible_errors

When looking at the examples it is not clear what the steps are to get the "old style" functionality back.

Doing a &meta=authmanagerinfo&amirequestsfor=create request on my MW 1.31 test wiki returned the following json below. It is not clear from the documentation how to use this information to get the "old style" functionality back.

I'd recommend to reintroduced the old api as a default e.g. by adding a parameter and doing the new style complicated stuff in the background to hide the introduced complexity for those who do not need it.

{
  "batchcomplete": "",
  "query": {
    "authmanagerinfo": {
      "canauthenticatenow": "",
      "cancreateaccounts": "",
      "preservedusername": "",
      "requests": [{
        "id": "MediaWiki\\Auth\\TemporaryPasswordAuthenticationRequest",
        "metadata": {},
        "required": "primary-required",
        "provider": "Temporary password",
        "account": "",
        "fields": {
          "mailpassword": {
            "type": "checkbox",
            "label": "Use a temporary random password and send it to the specified email address",
            "help": "Can be used to create account for another person without learning the password."
          }
        }
      }, {
        "id": "MediaWiki\\Auth\\PasswordAuthenticationRequest",
        "metadata": {},
        "required": "primary-required",
        "provider": "Password-based authentication",
        "account": "",
        "fields": {
          "username": {
            "type": "string",
            "label": "Username",
            "help": "Username for authentication."
          },
          "password": {
            "type": "password",
            "label": "Password",
            "help": "Password for authentication.",
            "sensitive": ""
          },
          "retype": {
            "type": "password",
            "label": "Retype password:",
            "help": "Password again to confirm.",
            "sensitive": ""
          }
        }
      }, {
        "id": "MediaWiki\\Auth\\UsernameAuthenticationRequest",
        "metadata": {},
        "required": "required",
        "provider": "MediaWiki\\Auth\\UsernameAuthenticationRequest",
        "account": "MediaWiki\\Auth\\UsernameAuthenticationRequest",
        "fields": {
          "username": {
            "type": "string",
            "label": "Username",
            "help": "Username for authentication."
          }
        }
      }, {
        "id": "MediaWiki\\Auth\\UserDataAuthenticationRequest",
        "metadata": {},
        "required": "required",
        "provider": "MediaWiki\\Auth\\UserDataAuthenticationRequest",
        "account": "MediaWiki\\Auth\\UserDataAuthenticationRequest",
        "fields": {
          "email": {
            "type": "string",
            "label": "Email",
            "help": "Email address",
            "optional": ""
          },
          "realname": {
            "type": "string",
            "label": "Real name",
            "help": "Real name of the user",
            "optional": ""
          }
        }
      }, {
        "id": "MediaWiki\\Auth\\CreationReasonAuthenticationRequest",
        "metadata": {},
        "required": "optional",
        "provider": "MediaWiki\\Auth\\CreationReasonAuthenticationRequest",
        "account": "MediaWiki\\Auth\\CreationReasonAuthenticationRequest",
        "fields": {
          "reason": {
            "type": "string",
            "label": "Reason",
            "help": "Message shown in the account creation log"
          }
        }
      }]
    }
  }
}

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 10 2019, 7:53 AM

Hey, I'm Liz. I am an Outreachy applicant. Can I take up this task?

@Liz_Kariuki: Hi and welcome. If you think that you know enough or can investigate yourself to work on this, feel free to! Thanks! :) (Please also see https://www.mediawiki.org/wiki/How_to_become_a_MediaWiki_hacker about feedback and communicating.)

Thank you!
Let me do my best

Basically in this task we are aiming to document the API:account_creation in MW 1.31 version.Is this correct?

No, you need to investigate if it is possible to still use the "old style" functionality and if possible document that for the latest version.

Seppl2013 added a comment.EditedOct 26 2019, 3:34 AM

I assume the "old style" is gone and needs to be emulated with the "new style". The idea would be to get a compatible API to ease the migration for people that are using the "old style" API. So the new API should have "new style" as is + "old style" which obviously would need some kind of flag/handling to indicate that "old style" is actually wanted since it is still possible to do an old style call but it will fail and might be considered deprecated if not flagged as "yes I still want to use that API".

@Liz_Kariuki: Hi! You assigned this task to yourself a few weeks ago. Could you maybe share a status update? Or is there anything that others could help with? :)

Aklapper removed Liz_Kariuki as the assignee of this task.Mon, Dec 9, 3:02 PM

@Liz_Kariuki: I am resetting the assignee of this task because there has not been progress lately (please correct me if I am wrong!). Please claim this task again when you plan to work on it (via Add Action...Assign / Claim in the dropdown menu) - it would be welcome. Thanks for your understanding.