API:Account creation/ak



Creating an account
Adeyɛ no wɔ anammɔn abiɛsa a ɛfa nneɛma nyinaa ho:


 * 1) Fa mfuw no fi  na fa token no fi.
 * 1) Send a POST request with the fetched token, user information and other fields, and return URL to the API.
 * 1) Deal with the response, which might involve further POST requests to supply more information.



Nhwɛsoɔ 1: Dwumadie wɔ wiki a enni ahotosoɔ ntrɛmu soronko
A wiki without special authentication extensions can be rather straightforward. If your code knows which fields will be required, it might skip the call to and just assume which fields will be needed (i.e. username, password &amp; retyped password, email, possibly realname).



Mmuae


koodu Nhwɛsode


Nhwɛsoɔ 2: Dwumadie wɔ wiki a ɛwɔ CAPTCHA ntrɛmu so
Hyɛ no nsow sɛ anammɔn a edi kan a ɛwɔ ase ha no betumi, sɛ wopɛ a, wɔbɛyɛ no sɛ anammɔn abien: biako sɛ wobɛfa afuw a ɛwɔ hɔ no afi na foforo nso wobɛfa token no afi.



Anamɔn a edi kan: Fa afuw a ɛwɔ hɔ fi ne token fi


Anamɔn a ɛtɔ so mmienu: Fa post abisadeɛ ka ho ne create account token, ɔdefoɔ ho nsɛm ne URL sanba


koodu Nhwɛsode
Hyɛ no nsow sɛ saa koodu nhwɛso yi tetew ne  abisade ahorow no mu, na mpɛn pii no ɛfa no sɛ CAPTCHA bɛba na nsɛnnennen foforo biara nni hɔ.



Nhwɛsoɔ 3: Akontaabuo a wɔayɛ wɔ wiki a ɛwɔ CAPTCHA, OpenID ntrɛmu, ne nneɛma mmienu ahotosoɔ ntrɛmu a wɔama ayɛ adwuma


Anamɔn a edi kan: Fa afuw a ɛwɔ hɔ fi ne token fi
ne a wɔde bɛba no yɛ nea ɛwɔ nhwɛso a atwam no mu no ara pɛ kɛse, na enti wɔnsan nyɛ bio wɔ ha. Abisadeɛ a wɔde bɛsan aba no din bɛka nkyerɛaseɛ a ɛfa CAPTCHA ntrɛmu ne OpenID ntrɛmu no nyinaa ho.

Anamɔn a ɛtɔ so mmienu: Bua CAPTCHA no na paw OpenID authentication.
Anka wɔbɛhwɛ kwan sɛ akraman no bɛdan ɔdefo no brawsa no akɔ redirecttarget a wɔde ama no so.

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.

Client no nya tumi wɔ dwumadie no so san wɔ saa beaeɛ yi na ɔyɛ ne API abisadeɛ a ɛdi hɔ no.

Anamɔn a ɛto so abiɛsa: San fi OpenID.
Akraman no de code ne state no san kɔ API no so. API no mmuaeɛ no wɔ nneɛma mmienu ahotosoɔ ntrɛmu a ɛkanyan ɔdefoɔ no sɛ ɔmfa wɔn factor a ɛtɔ so mmienu no nsi hɔ.

Afei na akraman no bɛka akyerɛ nea ɔde di dwuma no sɛ ɔmfa akontaabu foforo nsi hɔ wɔ wɔn nneɛma abien ho adansedi app no mu na ɔmfa mprempren koodu no nhyɛ mu, anaasɛ ɔmma nea ɔde di dwuma no kwan ma onhuruw 2FA nhyehyɛe no. Momma yɛmfa no sɛ nea ɔde di dwuma no yɛ set up 2FA.

Fourth step: Set up two-factor authentication.
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.

Additional notes

 * Account creations are recorded in Special:log/newusers.

If you are logged in, your username will also be recorded when creating an account.


 * While executing the code snippets provided on this page, remember:
 * Once an account on a wiki is created, it cannot be deleted.
 * Always use as the endpoint, so that you don't accidentally create accounts on production wikis.
 * MediaWiki site administrators and extension developers can disable this API feature by inserting the following line in the configuration file: