Open main menu


MediaWiki extensions manual
OOjs UI icon advanced.svg
Release status: stable
Description Dataporten OAuth2 extension
Author(s) (KasperRTtalk)
License MIT License
Translate the OAuth2Dataporten extension if it is available at
Check usage and version matrix.

The OAuth2Dataporten extension does foo.


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

Configuration parametersEdit

$wgOAuth2Dataporten['client']['id'] = getenv('DATAPORTEN_CLIENTID') ? getenv('DATAPORTEN_CLIENTID') : ;

$wgOAuth2Dataporten['client']['secret'] = getenv('DATAPORTEN_CLIENTSECRET') ? getenv('DATAPORTEN_CLIENTSECRET') : ; Client secret

$wgOAuth2Dataporten['config']['groups_array'] = getenv('DATAPORTEN_RIGHTS_ARRAY') ? json_decode(getenv('DATAPORTEN_RIGHTS_ARRAY'),true) : array(); Dataporten groups with their respective roles on mediawiki

$wgOAuth2Dataporten['config']['auth_endpoint'] = ''; urls of authorization, token and info

$wgOAuth2Dataporten['config']['token_endpoint'] = '';

$wgOAuth2Dataporten['config']['info_endpoint'] = '';

$wgOAuth2Dataporten['config']['auth_type'] = 'Bearer';

$wgOAuth2Dataporten['config']['group_endpoint'] = '';

$wgGroupPermissions['group']['right'] = true /* or false */;

$wgGroupPermissions['oauth2'] = $wgGroupPermissions['user'];