Blue Glass Arrow.svg MediaWiki-2020-logo.svg
This page should be moved to
Please do not move the page by hand. It will be imported by a administrator with the full edit history. In the meantime, you may continue to edit the page as normal.


This MediaWiki extension automatically logs you into your wiki using the credentials provided by the web server, for example through the HTTP Basic Authentication (BasicAuth) mechanism with .htaccess / .htpasswd.

See below for a changelog.

Installation & ConfigurationEdit

Copy and paste the source code and save it as BasicAutoAuth.php in your MediaWiki's extension directory. If you copy the contents from the edit window, remove the <pre> and </pre> tags at the top and the bottom. Do not forget to check code and edit history to make sure the extension has not been tampered with.

In your LocalSettings.php, add the following line:

require_once( "extensions/BasicAutoAuth.php" );

Important NotesEdit

  • Should work with MediaWiki 1.9 and newer
  • MediaWiki 1.8alpha (revision 15823) up to 1.8.2 were not compatible with this extension. Please consider using a newer version where the AutoAuthenticate bug is finally fixed (revision 17069 and above, bug 6929).
  • To log on under a different wiki account, log out and immediately click login again (or go straight to the login page)
  • The extension does not automatically create a wiki account
  • The extension checks if the password provided by the web server matches the one set for the wiki account. If you do not want this, see the following section

Removing password checkEdit

To disable password verification, replace the lines

        else {

            /* Check against supplied password */
            if ( $u  &&  $u->checkPassword( $_SERVER[ 'PHP_AUTH_PW' ] ) ) {
                $user = $u;

with these:

        else {
            $user = $u;


0.12 (2007-01-31)Edit

  • Fix: Improper version check prohibited the extension to load on MediaWiki 1.10alpha+

0.11 (2006-10-18)Edit

  • Fix: Use User::newFromSession on newer versions of MediaWiki instead of User::loadFromSession

0.10b (2006-07-19)Edit

  • Fix: Check if User::loadFromSession returned a User object
  • Fix: Check if $wgAuth is an object

0.10a (2006-07-16)Edit

  • Fix: Function to initialize User object did not reference User object but $this