Configure 2FA For MediaWiki: Difference between revisions
No edit summary |
No edit summary |
||
| Line 3: | Line 3: | ||
==Configure ''OATHAuth''== | ==Configure ''OATHAuth''== | ||
To configure your Mediawiki instance to allow users to enable two-factor authentication simply add | The version of Mediawiki I'm using has OATHAuth preinstalled. To configure your Mediawiki instance to allow users to enable two-factor authentication simply add | ||
<pre>wfLoadExtension( 'OATHAuth' );</pre> to the end of the ''LocalSettings.php'' file located in the root of the MediwWiki directory. Restart your HTTP server. In my case I simply run | <pre>wfLoadExtension( 'OATHAuth' );</pre> to the end of the ''LocalSettings.php'' file located in the root of the MediwWiki directory. Restart your HTTP server. In my case I simply run | ||
<pre>sudo systemctl restart httpd</pre> | <pre>sudo systemctl restart httpd</pre> | ||
Revision as of 16:03, 5 December 2024
How to use OATHAuth in Mediawiki
Configure OATHAuth
The version of Mediawiki I'm using has OATHAuth preinstalled. To configure your Mediawiki instance to allow users to enable two-factor authentication simply add
wfLoadExtension( 'OATHAuth' );
to the end of the LocalSettings.php file located in the root of the MediwWiki directory. Restart your HTTP server. In my case I simply run
sudo systemctl restart httpd
Install oathtool
There are a number of OATH clients on the market, but I decided to just install the oathtool command line tool on my Fedora based laptop, by running
sudo dnf install oathtool.x86_64
Apple has the same functionality built into the Passwords app, but as I only login from my Fedora based laptop, it's easier to run a command and copy the output to my clipboard.
I'll document how to register for 2FA here tomorrow. It's too late tonight.
I then run
oathtool --base32 --totp "REGISTERED KEY GOES HERE"
Which generates a 6 digit code to give to mediawiki when prompted.