Extension:AuthManagerOAuth

MediaWiki extensions manual
OOjs UI icon advanced-invert.svg
AuthManagerOAuth
Release status: experimental
Implementation User identity
Description Create accounts or login using OAuth
Author(s) Moritz Hedtke (Dev.mohetalk)
Latest version 0.2.0 (2022-05-07)
Compatibility policy Master maintains backward compatibility.
MediaWiki 1.35.0+
PHP 7.4+
Database changes Yes
Tables authmanageroauth_linked_accounts
License GNU General Public License 2.0 or later
Download
Changelog
$wgAuthManagerOAuthConfig

Check usage and version matrix.

The AuthManagerOAuth extension allows to create accounts or login using OAuth.

InstallationEdit

  • Download and place the file(s) in a directory called AuthManagerOAuth in your extensions/ folder.
  • Only when installing from Git, run Composer to install PHP dependencies, by issuing composer install --no-dev in the extension directory. (See task T173141 for potential complications.)
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'AuthManagerOAuth' );
    
  • Run the update script which will automatically create the necessary database tables that this extension needs.
  •   Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration parametersEdit

$wgAuthManagerOAuthConfig = [
    'github' => [
        'clientId'                => 'xxx',
        'clientSecret'            => 'xxx',
        'urlAuthorize'            => 'https://github.com/login/oauth/authorize',
        'urlAccessToken'          => 'https://github.com/login/oauth/access_token',
        'urlResourceOwnerDetails' => 'https://api.github.com/user'
    ],
    'google' => [
        // ...
    ]
];

The values in this keyed array have to conform to the parameter of the GenericProvider constructor at https://oauth2-client.thephpleague.com/usage/. The key cannot be changed afterwards as it's used in the database for storing the linked accounts.