MediaWiki may be integrated with CILogon using OpenID Connect (OAuth 2.O) for authentication and provisioning and lifecycle management of accounts by the CILogon Registry (COmanage).
Deploying MediaWiki and integrating it with CILogon requires:
These deployment instructions have been developed and tested for CentOS 7.x. Please adjust accordingly if you use another platform.
yum install epel-release
wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7*.rpm
Edit the file /etc/yum.repos.d/remi.repo and enable the [remi] and [remi-php56] repos, then
yum install php php-gd php-mysql php-mcrypt php-mbstring php-xml
yum install mariadb mariadb-server
systemctl enable mariadb
systemctl start mariadb
mysql_secure_installation
mysql --user=root --password
create database mediawiki;
grant all privileges on mediawiki.* to 'mediawiki'@'localhost' identified by '<password>';
yum install memcached php56-php-pecl-memcache
systemctl enable memcached
Edit /etc/sysconfig/memcached and add
OPTIONS="-l 127.0.0.1"
Then start memcached:
systemctl start memcached
Use the manual instructions.
Be sure you can login as the administrator using the standard login and password form.
Configure "short URLs" by editing LocalSettings.php and adding the line
$wgArticlePath = "/wiki/$1";
Then edit the Apache configuration and enable and configure the rewrite engine:
# Enable the rewrite engine
RewriteEngine On
# Short url for wiki pages
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]
# Redirect / to Main Page
RewriteRule ^/*$ %{DOCUMENT_ROOT}/w/index.php [L]
Restart Apache.
Edit LocalSettings.php and add
$wgMainCacheType = CACHE_MEMCACHED;
$wgParserCacheType = CACHE_MEMCACHED;
$wgMessageCacheType = CACHE_MEMCACHED;
$wgMemCachedServers = array( "127.0.0.1:11211" );
$wgSessionsInObjectCache = true;
$wgSessionCacheType = CACHE_MEMCACHED;
cd extensions
mkdir OAuth
cd OAuth
wget https://github.com/cilogon/mediawiki-extensions-OAuth/archive/REL1_28.tar.gz
tar zxf REL1_28.tar.gz --strip-components=1
rm REL1_28.tar.gz
cd ../../maintenance
php update.php
Edit LocalSettings.php and add
$wgWhitelistRead = array('Special:OAuth');
require_once "$IP/extensions/OAuth/OAuth.php";
$wgOAuthSecretKey = "SOME_LONG_STRING";
$wgMWOAuthSecureTokenTransfer = true;
where SOME_LONG_STRING is a random string, eg. E5UtLI5tRqq7dPcBKG6n.
Also add the following to LocalSettings.php:
$wgGroupPermissions['*']['mwoauthproposeconsumer'] = false;
$wgGroupPermissions['*']['mwoauthupdateownconsumer'] = false;
$wgGroupPermissions['*']['mwoauthmanageconsumer'] = false;
$wgGroupPermissions['*']['mwoauthsuppress'] = false;
$wgGroupPermissions['*']['mwoauthviewsuppressed'] = false;
$wgGroupPermissions['*']['mwoauthviewprivate'] = false;
$wgGroupPermissions['*']['mwoauthmanagemygrants'] = false;
$wgGroupPermissions['user']['mwoauthproposeconsumer'] = false;
$wgGroupPermissions['user']['mwoauthupdateownconsumer'] = false;
$wgGroupPermissions['user']['mwoauthmanageconsumer'] = false;
$wgGroupPermissions['user']['mwoauthsuppress'] = false;
$wgGroupPermissions['user']['mwoauthviewsuppressed'] = false;
$wgGroupPermissions['user']['mwoauthviewprivate'] = false;
$wgGroupPermissions['user']['mwoauthmanagemygrants'] = false;
$wgGroupPermissions['sysop']['mwoauthproposeconsumer'] = true;
$wgGroupPermissions['sysop']['mwoauthupdateownconsumer'] = true;
$wgGroupPermissions['sysop']['mwoauthmanageconsumer'] = true;
$wgGroupPermissions['sysop']['mwoauthsuppress'] = true;
$wgGroupPermissions['sysop']['mwoauthviewsuppressed'] = true;
$wgGroupPermissions['sysop']['mwoauthviewprivate'] = true;
$wgGroupPermissions['sysop']['mwoauthmanagemygrants'] = true;
As the wiki admin browse to the Special:SpecialPages page for your wiki and click on "Create account". Create an account with
Use the mysql client to connect to the database and mark the email for the user you just used as authenticated, eg.
UPDATE user SET user_email_authenticated = user_touched WHERE user_id = 2;
Still as the administrator browse to Special:UserRights and temporarily add the COmanageRegistryProvisioner user to the administrator group.
Log out as the administrator and log in as the COmanageRegistryProvisioner. Then browse to Speical:OAuthConsumerRegistration. Click on "Request a token for a new consumer". Complete the form:
Record the values for the Consumer token, Consumer secret, Access token, and Access secret
Log out and log back in as the wiki admin. Use the Special:UserRights page to remove the COmanageRegistryProvisioner account from the administrator group.
Edit LocalSettings.php and add
$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['user']['createaccount'] = false;
$wgGroupPermissions['sysop']['createaccount'] = false;
$wgGroupPermissions['provisioner']['createaccount'] = true;
Use the Special:UserRights page again to add the COmanageRegistryProvisioner account to the provisioner group.
We recommend two identifiers to be managed by COmanage Registry be configured for auto-assignment in your registry:
Please email help@cilogon.org with any questions about how to create the identifier assignments in COmanage.
Log into COmanage Registry as the CO administrator for your organization and choose Configuration -> Provisioning Targets from the menu. Click "Add Provisioning Target" and complete the form to add a new MediaWiki Provisioner.
After adding the new provisioner you will be presented the form to configure it. Complete the form with the API URL for your MediaWiki deployment and the OAuth consumer token/key, secret, access token, and access secret from step 11. Choose the identifier you configured in step 13 as the name-based identifier that will be provisioned as the MediaWiki username that the user sees.
After saving the MediaWiki Provisioner configuration in COmanage Registry click "Reprovision All" next to the MediaWiki provisioning target to provision users to MediaWiki.
Log into MediaWiki as the administrator and browse to the Special:UserRights page. Add one or more of the provisioned users to the Administrators group so that after OIDC authentication is enabled those users may easily administer the wiki.
Log into the CILogon Registry (COmanage) as an administrator. Use the menu Configuration->OIDC Clients and then click "Add a New OIDC Client". Complete the form with the following details:
Click "Add" to submit the form and create the OIDC client.
Record the client ID and client secret. You must record the client secret since it is not saved by the CILogon services.
cd extensions
mkdir PluggableAuth
cd PluggableAuth
wget https://github.com/wikimedia/mediawiki-extensions-PluggableAuth/archive/5.0.tar.gz
tar zxf 5.0.tar.gz --strip-components=1
rm 5.0.tar.gz
cd ../
mkdir OpenIDConnect
cd OpenIDConnect
wget https://github.com/wikimedia/mediawiki-extensions-OpenIDConnect/archive/4.0.tar.gz
tar zxf 4.0.tar.gz --strip-components=1
rm 4.0.tar.gz
composer update
cd ../../maintenance
php update.php
Edit LocalSettings.php and add
wfLoadExtension( 'PluggableAuth' );
wfLoadExtension( 'OpenIDConnect' );
$wgOpenIDConnect_Config['https://test.cilogon.org'] = array(
'clientID' => 'YOUR CLIENT ID',
'clientsecret' => 'YOUR CLIENT SECRET',
'scope' => array( 'openid', 'profile', 'email', 'org.cilogon.userinfo' ),
'name' => 'CILogon'
);
$wgOpenIDConnect_MigrateUsersByUserName = true;
$wgPluggableAuth_EnableLocalLogin = true;
With a web browser with no existing sessions or state browse to your wiki and click "Log in". Click on "Log in with PluggableAuth" to be redirected to the CILogon service and choose your login server. After authenticating with the login server you should be logged into the wiki and see your username.