MediaWiki API ヘルプ

このページは自動生成された MediaWiki API の説明文書ページです。

説明文書と例: https://www.mediawiki.org/wiki/Special:MyLanguage/API:Main_page

action=clientlogin (login)

(main | clientlogin)
  • このモジュールは書き込みの権限を必要とします。
  • このモジュールは POST リクエストのみを受け付けます。
  • ソース: MediaWiki
  • ライセンス: GPL-2.0-or-later

インタラクティブフローを使用してウィキにログインします。

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.
パラメーター:
その他一般パラメーターが利用可能です。
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.

複数の値は | または代わりの文字で区切ってください。
値の最大値は 50(緩い制限が適用されるクライアントでは500)です。
loginmessageformat

Format to use for returning messages.

値 (次の値のいずれか1つ): html、none、raw、wikitext
既定: wikitext
loginmergerequestfields

Merge field information for all authentication requests into one array.

型: 真偽値 (詳細)
loginpreservestate

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

型: 真偽値 (詳細)
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.

型: 真偽値 (詳細)
logintoken

action=query&meta=tokens から取得した「login」トークン

この変数は必須です。
*
This module accepts additional parameters depending on the available authentication requests. Use action=query&meta=authmanagerinfo with amirequestsfor=login (or a previous response from this module, if applicable) to determine the requests available and the fields that they use.
例:
利用者 Example としてのログイン処理をパスワード ExamplePassword で開始する
api.php?action=clientlogin&username=Example&password=ExamplePassword&loginreturnurl=http://example.org/&logintoken=123ABC [サンドボックスで開く]
987654OATHTokenを提供する2段階認証のUIレスポンスの後にログインを続けます。
api.php?action=clientlogin&logincontinue=1&OATHToken=987654&logintoken=123ABC [サンドボックスで開く]