API:Checktoken

From MediaWiki.org
Jump to navigation Jump to search

Other languages:
English • ‎dansk • ‎français • ‎polski • ‎ไทย • ‎日本語

Checks the validity of a token from the tokens module.

Parameters[edit]

  • type: Type of token being tested. Possible values: csrf, patrol, rollback, userrights, watch. On Mediawiki servers, CentralAuth also adds deleteglobalaccount and setglobalaccountstatus.
  • token: Token to test.
  • maxtokenage: Maximum allowed age of the token, in seconds.

Example[edit]

Check a CSRF token.





action=checktoken

(main | checktoken)

Check the validity of a token from action=query&meta=tokens.

Parameters:
type

Type of token being tested.

This parameter is required.
One of the following values: createaccount, csrf, deleteglobalaccount, login, patrol, rollback, setglobalaccountstatus, userrights, watch
token

Token to test.

This parameter is required.
maxtokenage

Maximum allowed age of the token, in seconds.

Type: integer