API:Account creation/de

Erstellen eines Kontos
Der Prozess umfasst drei Schritte:


 * 1) Fetch the fields from  and the token from.
 * 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.

Beispiel 1: Prozess für ein Wiki ohne spezielle Authentifizierungserweiterungen
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).

Beispiel 2: Prozess für ein Wiki mit einer CAPTCHA-Erweiterung
Note the first step below could, if you'd rather, be done as two steps: one to fetch the fields available from and another to fetch the token from.

Beispielcode
Note this code sample separates the and  requests, and generally assumes there will be a CAPTCHA and no other complications.

First step: Fetch fields available from and token from
The fetching of and  is largely the same as in the previous example, and so is not repeated here. The list of requests returned by will include definitions for both the CAPTCHA extension and the OpenID extension.

Zweiter Schritt: ausfüllen der CAPTCHA und Auswahl von OpenID-Authentifikation
Vom Client wird erwartet, den Browser des Benutzers zum bereitgestellten redirecttarget weiterzuleiten.

Der OpenID-Anbieter sollte authentifizieren und zu Special:OpenIDConnectReturn im Wiki weiterleiten, was die OpenID-Antwort validieren würde und dann weiterleiten zur createreturnurl, die im ersten POST an die API bereitgestellt wurde, mit angehängten code - und state -Parametern.

Der Client erhält an diesem Punkt die Kontrolle über den Prozess zurück und macht seine nächste API-Anfrage.

Third step: Back from OpenID.
The client posts the code and state back to the API. The API's response has the two-factor authentication extension prompting the user to set up their second factor.

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.

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.

Zusätzliche Anmerkungen

 * 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: