MediaWiki Radius Authentication Extension – RadiusAuthPlugin

Posted on Updated on

Here is an extension / plugin for mediawiki to authenticate against a Radius server. I couldn’t find one anywhere else, which is surprising. I can’t believe I am the first person to want to do this. Anyway, this is just bare bones, but it works for an internal mediawiki setup.

First, get Pure PHP radius class 1.2.2 from http://developer.sysco.ch/php. This does the actual radius authentication. Put radius.class.php in wiki/extensions/ (assuming wiki is your mediawiki install). There is probably a better place to put it, but I was setting this up for internal use and wanted to get it working quickly.

Next, create wiki/extensions/RadiusAuthPlugin.php. Make sure you fill in RADIUS_SERVER, SHARED_SECRET, and NAS_IP_ADDRESS with your actual information.  Lastly, update your LocalSetup.php.

You can find the RadiusAuthPlugin.php and the part to add to LocalSetup.php in this gist:

https://gist.github.com/jamsyoung/8514607

About these ads

10 thoughts on “MediaWiki Radius Authentication Extension – RadiusAuthPlugin

    Activities on a Songkran day « Nattachart's Blog said:
    April 14, 2010 at 1:19 pm

    […] so I searched for integrating MediaWiki with a Radius system and found only this blog http://psyjinx.com/jyoung/2010/02/mediawiki-radius-authentication-extension-radiusauthplugin/ telling about what I was looking for. I just went through it and realized this was the first […]

    Andre Liechti said:
    May 7, 2010 at 5:15 pm

    Hello,

    I’m happy that my Pure PHP radius class is used for the MediaWiki project ;-)

    If you need to log some stuff, have also a look at my Syslog class, which is a pure PHP syslog device implementation following the RFC 3164 rules.

    Regards,

    Andre

    Dude said:
    September 30, 2011 at 6:34 am

    I have question where u get require_once(‘AuthPlugin.php’);? in radius php class archive i couldn’t find it! maybe i am looking in wrong place!

    thx!

    Dan Benson said:
    December 7, 2011 at 3:59 pm

    Any chance there is an update for this to work in Mediawiki 1.18? It seems to be broken.

    Thanks in advance,

    db

      Dan Benson said:
      December 7, 2011 at 4:21 pm

      James,

      Nevermind, issue was my fat fingering. Plugin works perfectly in 1.18.

      Nice work and thanks again.

      db

    Dan Benson said:
    December 15, 2011 at 12:17 pm

    James,

    Think we can get this script to send accounting information to the rad server?

    Thanks,

    db

    Christian Ohlendorff Knudsen said:
    May 14, 2012 at 8:20 am

    Excellent, worked like a charm on Debian 6.0.2 and Mediawiki 1.15.5 (straight from the repositories).

    plutonji said:
    July 27, 2012 at 3:55 am

    Hello! I filled SHARED_SECRET and NAS_IP_ADDRESS, but why It told me “Parse error: syntax error, unexpected T_STRING in /www/web/default/extensions/RadiusAuthPlugin.php on line 34″ ?

      james young responded:
      July 27, 2012 at 8:12 am

      They should both be in quotes, is a quote missing? Without seeing your code I can’t know for sure, but that would be my first guess

    plutonji said:
    July 27, 2012 at 5:15 am

    I‘m using Mediawiki-1.19.1

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s