Extension:NetworkAuth

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
NetworkAuth

Release status: experimental

Implementation User identity, User rights
Description Allows you to authenticate users based on network information
Author(s) Tim Laquatalk
Last version 1.0 (19 December 2007(2007-12-19))
MediaWiki 1.11+
License No license specified
Download
Parameters

$wgNetworkAuthUsers[]

Hooks used
PersonalUrls

BeforePageDisplay

Check usage and version matrix

NetworkAuth extension is intended to basically bind a username to a particular network address. The reason it was developed was to grant read access to a particular subnet on a Wiki that denied read access to anonymous users. The assumption is that there are certainly times when Physical security is enough to allow access to certain resources.

In this extension, IP ranges, IP regex patterns, or hostname patters are associated with a MediaWiki username. It is reccommended that you create an account specifically for this purpose. Multiple ranges/patterns can be associated with multiple users.

NOTE: Hostpatterns are relatively unreliable. Use at your own risk - often the lookup times out and you won't get a match.

Installation [edit]

  1. Create a new folder (directory) in the following location:
    $IP/extensions/NetworkAuth
  2. Download the extension
  3. Copy the files in to the new NetworkAuth folder
  4. Add the following code to your LocalSettings.php (at the bottom)
    • NOTE - settings for $wgNetworkAuthUsers[] are EXAMPLES ONLY!
require_once( "$IP/extensions/NetworkAuth/NetworkAuth.php" );
 
$wgNetworkAuthUsers[] = array(
        'iprange'               => array('10.1.10.0/24',
                                         '10.2.10.152/32'),
        'user'                  => 'CircComputer');
 
$wgNetworkAuthUsers[] = array(
        'ippattern'             => '/10\.1\.10\..*/',
        'user'                  => 'RefComputer');
 
$wgNetworkAuthUsers[] = array(
        'hostpattern'           => '/.*\.domain\.example\.com/i',
        'user'                  => 'AdminComputer');

Usage [edit]

  1. Follow Installation Instructions
  2. Users connecting from the specified network ranges will be authenticated (sort of) as the user associated with that range.