Pomoc API MediaWiki

Semantic MediaWikiThis message will disappear after all relevant tasks have been resolved.

There are 1 incomplete or pending task to finish installation of Semantic MediaWiki. An administrator or user with sufficient rights can complete it. This should be done before adding new data to avoid inconsistencies.

To jest automatycznie wygenerowana strona dokumentacji API MediaWiki.

Dokumentacja i przykłady: https://www.mediawiki.org/wiki/Special:MyLanguage/API:Main_page

action=clientlogin (login)

(main | clientlogin)
  • Ten moduł wymaga praw zapisu.
  • Ten moduł akceptuje tylko żądania POST.
  • Źródło: MediaWiki
  • Licencja: GPL-2.0-or-later

Zaloguj się na wiki używając interaktywnego flow.

The general procedure to use this module is:

  1. Fetch the fields available from action=query&meta=authmanagerinfo with amirequestsfor=login, and a login token from action=query&meta=tokens.
  2. Present the fields to the user, and obtain their submission.
  3. Post to this module, supplying loginreturnurl and any relevant fields.
  4. Check the status in the response.
    • If you received PASS or FAIL, you're done. The operation either succeeded or it didn't.
    • If you received UI, present the new fields to the user and obtain their submission. Then post to this module with logincontinue and the relevant fields set, and repeat step 4.
    • If you received REDIRECT, direct the user to the redirecttarget and wait for the return to loginreturnurl. Then post to this module with logincontinue and any fields passed to the return URL, and repeat step 4.
    • If you received RESTART, that means the authentication worked but we don't have a linked user account. You might treat this as UI or as FAIL.
Parametry:
Other general parameters are available.
loginrequests

Only use these authentication requests, by the id returned from action=query&meta=authmanagerinfo with amirequestsfor=login or from a previous response from this module.

Oddziel wartości za pomocą | lub alternatywy.
Maksymalna liczba wartości to 50 (500 dla klientów mogących korzystać z podwyższonych limitów).
loginmessageformat

Format to use for returning messages.

Jedna z następujących wartości: html, none, raw, wikitext
Domyślnie: wikitext
loginmergerequestfields

Merge field information for all authentication requests into one array.

Typ: wartość boolowska (szczegóły)
loginpreservestate

Preserve state from a previous failed login attempt, if possible.

Typ: wartość boolowska (szczegóły)
loginreturnurl

Return URL for third-party authentication flows, must be absolute. Either this or logincontinue is required.

Upon receiving a REDIRECT response, you will typically open a browser or web view to the specified redirecttarget URL for a third-party authentication flow. When that completes, the third party will send the browser or web view to this URL. You should extract any query or POST parameters from the URL and pass them as a logincontinue request to this API module.

logincontinue

This request is a continuation after an earlier UI or REDIRECT response. Either this or loginreturnurl is required.

Typ: wartość boolowska (szczegóły)
loginreauthenticate

Instead of logging in, reauthenticate for getting temporary access to a security-sensitive operation. This must be done when already logged in, using the fields suplied by action=query&meta=authmanagerinfo when called with the amireauthenticate parameter. The value of the parameter should be the same as that of amireauthenticate.

logintoken

Token „login” pobrany z action=query&meta=tokens

Ten parametr jest wymagany.
*
Ten moduł akceptuje dodatkowe parametry, w zależności od dostępnych żądań poświadczeń. Użyj action=query&meta=authmanagerinfo z amirequestsfor=login (lub poprzednią odpowiedzią tego modułu, jeśli dotyczy) aby określić dostępne żądania i pola, których używają.
Przykłady:
Rozpocznij proces logowania się do wiki jako użytkownik Example z hasłem ExamplePassword.
api.php?action=clientlogin&username=Example&password=ExamplePassword&loginreturnurl=http://example.org/&logintoken=123ABC [otwórz w brudnopisie]
Kontynuuj logowanie po prośbie od UI o weryfikację dwuetapową, dostarczając OATHToken o wartości 987654.
api.php?action=clientlogin&logincontinue=1&OATHToken=987654&logintoken=123ABC [otwórz w brudnopisie]