Extension:OAuth2Github

From MediaWiki.org
Jump to navigation Jump to search


MediaWiki extensions manual
Crystal Clear action run.svg
OAuth2Github
Release status: stable
Description Github OAuth2 extension
Author(s) (Stefan2904talk)
License MIT License
Download https://github.com/LosFuzzys/MediaWiki-OAuth2-Github
Hooks used
UserLogout
UserLoginForm
BeforePageDisplay
LoadExtensionSchemaUpdates
Translate the OAuth2Github extension if it is available at translatewiki.net
Check usage and version matrix.

The OAuth2Github MediaWiki extension enables login to your Mediawiki with Github as OAuth2 identity provider.

Installation[edit]

  • Download and place the file(s) in a directory called OAuth2Github in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    require_once "$IP/extensions/OAuth2Github/OAuth2Github.php";
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration parameters[edit]

$wgOAuth2Github['client']['id']             = '';
$wgOAuth2Github['client']['secret']         = '';

$wgOAuth2Github['config']['required_org']   = 'LosFuzzys';
$wgOAuth2Github['config']['auth_endpoint']  = 'https://github.com/login/oauth/authorize'; 
$wgOAuth2Github['config']['token_endpoint'] = 'https://github.com/login/oauth/access_token';
$wgOAuth2Github['config']['info_endpoint']  = 'https://api.github.com/user';
$wgOAuth2Github['config']['auth_type']      = 'token';

The callback url back to your wiki would be: http://your.wiki.domain/path/to/wiki/Special:OAuth2Github/callback