Extension:OAuth2Dataporten
![]() | This extension is currently not actively maintained! Although it may still work, any bug reports or feature requests will more than likely be ignored. |
OAuth2Dataporten Release status: unmaintained |
|
---|---|
Description | Dataporten OAuth2 extension |
Author(s) | (KasperRTtalk) |
License | MIT License |
Download | GitHub: Note: |
Installation[edit]
- Download and place the file(s) in a directory called
OAuth2Dataporten
in yourextensions/
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 parameters[edit]
$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'];