triauth for MediaWikiOIDC
Let your team sign in to your wiki with one approval on their own device, through the OpenID Connect extension.
- Sign-in through
- OpenID Connect bridge
- Available in
- MediaWiki 1.42 and newer, with the PluggableAuth and OpenID Connect extensions
- Set up in
LocalSettings.php
About MediaWiki
MediaWiki is the wiki software that runs Wikipedia. Organizations use it for internal knowledge bases, documentation, and intranet wikis.
Connect MediaWiki to triauth
MediaWiki signs people in through the triauth OpenID Connect bridge, with two extensions: PluggableAuth, the login framework, and OpenID Connect, the protocol plugin. Once connected, the wiki's login page shows a button carrying your domain's name. People on your team click it, type their username, and approve on their own device. Nobody keeps a wiki password, and when someone leaves, removing their identity records at your domain ends their access to the wiki as well.
How it works
Install the PluggableAuth and OpenID Connect extensions into your wiki's
extensionsfolder, as their pages describe.Open oidc.triauth.org and enter your domain. Paste the wiki's redirect address, the full address of its
Special:PluggableAuthLoginpage, such ashttps://wiki.example.com/index.php/Special:PluggableAuthLogin, and click Connect app. The bridge gives you a client ID and a client secret.Add the lines below to
LocalSettings.php. Replaceexample.comwith your domain and the two placeholders with the client ID and the client secret from the bridge.phpwfLoadExtension( 'PluggableAuth' ); wfLoadExtension( 'OpenIDConnect' ); $wgPluggableAuth_Config['example.com'] = [ 'plugin' => 'OpenIDConnect', 'data' => [ 'providerURL' => 'https://oidc.triauth.org/example.com', 'clientID' => '<client ID from the bridge>', 'clientsecret' => '<client secret from the bridge>', 'scope' => [ 'openid', 'profile', 'email', 'groups' ], ], ]; $wgGroupPermissions['*']['autocreateaccount'] = true;Open the wiki's login page and click the button with your domain's name.
Checkpoint
The wiki's login page shows a button with your domain's name. Choosing it opens a page from the bridge that asks for the username, and the person's authenticator asks them to approve.
Good to know
- Everyone with an identity at your domain gets a wiki account the first time they sign in, named after their username, such as
Johnforjohn@example.com. To let only one team in, limit the app to a group when you connect it. - With a
groupsyncsentry in the configuration, the wiki's user groups follow the groups published at your domain. $wgPluggableAuth_EnableAutoLoginsends visitors straight to the bridge, and$wgPluggableAuth_EnableLocalLoginkeeps or hides the password form.
For the person who connects the app
| Setting | Value |
|---|---|
| Redirect address | the full address of Special:PluggableAuthLogin, which depends on your wiki's URL scheme and language |
| Where in MediaWiki | LocalSettings.php, after the two wfLoadExtension lines |
| Provider URL | https://oidc.triauth.org/<your domain>, from which the extension reads the rest |
| Usernames | from preferred_username, the default, the person's username. $wgOpenIDConnect_UseRealNameAsUserName takes it from the name claim instead |
| Groups | 'groupsyncs' => [ [ 'type' => 'syncall' ] ] in the configuration, which reads the groups claim |
| PKCE | optional, 'codeChallengeMethod' => 'S256' |
The extension keeps the client secret, so leave This app can't keep a secret unticked when you connect it on the bridge. The OpenID Connect extension page and the PluggableAuth page explain every setting.
Next steps
- Read the OpenID Connect bridge page for what every connected app gets and what the bridge keeps private.
- Read Roll out to your team to give everyone in your organization an identifier at your domain.
- Read Groups to publish teams and sync them into the wiki.
- Read the OpenID Connect extension page for every setting it offers.
All logos and trademarks belong to their respective owners and do not imply affiliation or endorsement of the organization or product by triauth, nor vice versa. The content provided on this page may include information from third-party sources. We do not assume any responsibility for the completeness, correctness, or applicability of the information. You should independently verify any details before relying on them.