Open main menu


MediaWiki extensions manual
OOjs UI icon advanced.svg
Release status: stable
Implementation User identity , User rights , API
Description Allow users to safely authorize another application ("consumer") to use the MediaWiki action API on their behalf.
Compatibility policy release branches
Database changes Yes
Tables oauth_accepted_consumer
License GNU General Public License 2.0 or later
  • $wgMWOAuthCentralWiki
  • $wgMWOAuthSharedUserSource
  • $wgMWOAuthRequestExpirationAge
  • $wgMWOAuthSecureTokenTransfer
  • $wgOAuthSecretKey
  • $wgOAuthGroupsToNotify
  • mwoauthproposeconsumer
  • mwoauthupdateownconsumer
  • mwoauthmanageconsumer
  • mwoauthsuppress
  • mwoauthviewsuppressed
  • mwoauthviewprivate
  • mwoauthmanagemygrants
Translate the OAuth extension if it is available at
Check usage and version matrix.
Vagrant role oauth
Issues Open tasks · Report a bug

The OAuth extension implements an OAuth 1.0a server in MediaWiki. It allows third party developers to securely develop applications ("consumers"), to which users can give a limited set of permissions ("grants"), so that the application can use the MediaWiki action API on the user's behalf.

Note Note: If you're attempting to develop an application that uses OAuth on a wiki, see OAuth for Developers. If you are trying to use an OAuth-enabled tool on a wiki which has this extension installed, see Help:OAuth.


  • OAuth relies on the object cache for temporary tokens and sessions. This should work as long as cache configuration settings are sane. (Older versions required Memcached explicitly.)
  • Currently, only mysql and sqlite database backends are supported
  • If the mediawiki installation is private (i.e. users need to log in to have read access), Special:OAuth will need to be added to the white list.


To users running MediaWiki 1.24 or earlier:

The instructions above describe the new way of installing this extension using wfLoadExtension(). If you need to install this extension on these earlier versions (MediaWiki 1.24 and earlier), instead of wfLoadExtension( 'OAuth' );, you need to use:

require_once "$IP/extensions/OAuth/OAuth.php";

User rightsEdit

Right Description
mwoauthproposeconsumer User can propose a new Consumer
mwoauthupdateownconsumer Modify a Consumer
mwoauthmanageconsumer Approve a Consumer
mwoauthsuppress Hide details about a Consumer
mwoauthviewsuppressed View hidden details about a Consumer
mwoauthviewprivate View private details about a Consumer, such as the hmac secret
mwoauthmanagemygrants Right for users to manage what rights they have authorized for each Consumer. Typically, this right will not be granted to an OAuth Consumer.

To assign a permission to some group, for example to sysops, you add following line to LocalSettings.php:

$wgGroupPermissions['sysop']['mwoauthproposeconsumer'] = true;


Variable name Default value Description
$wgMWOAuthCentralWiki false Wiki ID of the wiki where OAuth grants are stored and Consumers registered, if OAuth credentials are shared over a wiki farm
$wgMWOAuthSharedUserIDs false deprecated, use $wgMWOAuthSharedUserSource instead
$wgMWOAuthSharedUserSource null Central ID provider when sharing OAuth credentials over a wiki farm
$wgMWOAuthRequestExpirationAge 2592000 (30 days) Seconds after which an idle request for a new Consumer is marked as "expired"
$wgMWOAuthSecureTokenTransfer false Require SSL/TLS for returning Consumer and user secrets. This is required by RFC 5849, however if a wiki wants to use OAuth, but doesn't support SSL, this option makes this configuration possible. This should be set to true for most production settings.
$wgOAuthSecretKey $wgSecretKey A secret configuration string used to hmac the database-stored secret to produce the shared secrets for Consumers. This provides some protection against an attacker reading the values out of the consumer table (the attacker would also need $wgOAuthSecretKey to generate valid secrets), and some protection against potential weaknesses in the secret generation. If this string is compromised, the site should generate a new $wgOAuthSecretKey, which will invalidate Consumer authorizations that use HMAC/shared secret signatures instead of public/private keys. Consumers can regenerate their new shared secret by using the "Reset the secret key to a new value" option under Special:MWOAuthConsumerRegistration/update.
$wgOAuthGroupsToNotify [] The list of user groups which should be notified about new consumer proposals. Setting this will only have an effect when Echo is installed.
If OAuth credentials are shared over a wiki farm, make sure that real names are used/hidden consistently across all wikis (using $wgHiddenPrefs ). On wikis where real names are hidden, the OAuth permission request message that tells the user which information is shared does not mention the real name, so in that case there should not be any other wiki where the OAuth consumer may still get that information from.

See alsoEdit

  • Extension:OAuthAuthentication – A MediaWiki extension that lets your wiki delegate authentication to another wiki that is running Extension:OAuth.
  • Extension:OATHAuth - A similarly named extension which implements a second authentication factor using OATH-based one-time passwords.
  • oauthclient-php – a client library for OAuth consumers.