Extension:OAuth2Dataporten

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

The OAuth2Dataporten extension does foo.

InstallationEdit

  • 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'] = 'https://auth.dataporten.no/oauth/authorization'; urls of authorization, token and info

$wgOAuth2Dataporten['config']['token_endpoint'] = 'https://auth.dataporten.no/oauth/token';

$wgOAuth2Dataporten['config']['info_endpoint'] = 'https://auth.dataporten.no/userinfo';

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

$wgOAuth2Dataporten['config']['group_endpoint'] = 'https://groups-api.dataporten.no/groups/me/groups';

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

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