2012-02-25 23:45:20 +01:00
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" xml:lang = "en"
lang="en" dir="ltr">
< head >
< meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" / >
< title > < / title >
<!-- metadata -->
< meta name = "generator" content = "Offline" / >
< meta name = "version" content = "Offline 0.1" / >
<!-- style sheet links -->
< link rel = "stylesheet" media = "all" type = "text/css" href = "../../../../css/all.css" / >
< link rel = "stylesheet" media = "screen" type = "text/css" href = "../../../../css/screen.css" / >
< link rel = "stylesheet" media = "print" type = "text/css" href = "../../../../css/print.css" / >
< / head >
< body >
< div class = "dokuwiki export" >
2015-06-08 16:57:58 +02:00
< h1 class = "sectionedit1" id = "mediawiki" > MediaWiki< / h1 >
2012-02-25 23:45:20 +01:00
< div class = "level1" >
< p >
2015-12-18 10:46:34 +01:00
< a href = "/_detail/applications/mediawiki_logo.png?id=documentation%3A1.9%3Aapplications%3Amediawiki" class = "media" title = "applications:mediawiki_logo.png" > < img src = "../../../../media/applications/mediawiki_logo.png" class = "mediacenter" alt = "" / > < / a >
2012-02-25 23:45:20 +01:00
< / p >
< / div >
2015-06-08 16:57:58 +02:00
<!-- EDIT1 SECTION "MediaWiki" [1 - 66] -->
< h2 class = "sectionedit2" id = "presentation" > Presentation< / h2 >
2012-02-25 23:45:20 +01:00
< div class = "level2" >
< p >
< a href = "http://www.mediawiki.org" class = "urlextern" title = "http://www.mediawiki.org" rel = "nofollow" > MediaWiki< / a > is a wiki software, used by the well known < a href = "http://www.wikipedia.org" class = "urlextern" title = "http://www.wikipedia.org" rel = "nofollow" > Wikipedia< / a > .
< / p >
< p >
2015-06-08 16:57:58 +02:00
Several extensions allows to configure < abbr title = "Single Sign On" > SSO< / abbr > on MediaWiki:
2012-02-25 23:45:20 +01:00
< / p >
< ul >
< li class = "level1" > < div class = "li" > < a href = "http://www.mediawiki.org/wiki/Extension:AutomaticREMOTE_USER" class = "urlextern" title = "http://www.mediawiki.org/wiki/Extension:AutomaticREMOTE_USER" rel = "nofollow" > Automatic REMOTE_USER< / a > < / div >
< / li >
< li class = "level1" > < div class = "li" > < a href = "http://www.mediawiki.org/wiki/Extension:Siteminder_Authentication" class = "urlextern" title = "http://www.mediawiki.org/wiki/Extension:Siteminder_Authentication" rel = "nofollow" > Siteminder Authentication< / a > < / div >
< / li >
< li class = "level1" > < div class = "li" > < a href = "http://www.mediawiki.org/wiki/Extension:HttpAuth" class = "urlextern" title = "http://www.mediawiki.org/wiki/Extension:HttpAuth" rel = "nofollow" > HTTP Auth< / a > < / div >
< / li >
< / ul >
< p >
We will explain how to use the latest: < a href = "http://www.mediawiki.org/wiki/Extension:HttpAuth" class = "urlextern" title = "http://www.mediawiki.org/wiki/Extension:HttpAuth" rel = "nofollow" > HTTP Auth< / a > .
< / p >
< / div >
2015-06-08 16:57:58 +02:00
<!-- EDIT2 SECTION "Presentation" [67 - 635] -->
< h2 class = "sectionedit3" id = "installation" > Installation< / h2 >
2012-02-25 23:45:20 +01:00
< div class = "level2" >
< p >
2015-06-08 16:57:58 +02:00
The HTTP Auth extension is presented here: < a href = "http://www.mediawiki.org/wiki/Extension:HttpAuth" class = "urlextern" title = "http://www.mediawiki.org/wiki/Extension:HttpAuth" rel = "nofollow" > http://www.mediawiki.org/wiki/Extension:HttpAuth< / a >
2012-02-25 23:45:20 +01:00
< / p >
< p >
You can download the code here: < a href = "http://github.com/oremj/mediawiki-http-auth/downloads" class = "urlextern" title = "http://github.com/oremj/mediawiki-http-auth/downloads" rel = "nofollow" > http://github.com/oremj/mediawiki-http-auth/downloads< / a >
< / p >
< p >
You have to install < code > HttpAuthPlugin.php< / code > in the < code > extensions/< / code > directory of your MediaWiki installation:
< / p >
2015-06-08 16:57:58 +02:00
< pre class = "code" > cp HttpAuthPlugin.php extenstions/< / pre >
2012-02-25 23:45:20 +01:00
< / div >
2015-06-08 16:57:58 +02:00
<!-- EDIT3 SECTION "Installation" [636 - 1008] -->
< h2 class = "sectionedit4" id = "configuration" > Configuration< / h2 >
2012-02-25 23:45:20 +01:00
< div class = "level2" >
< / div >
2015-06-08 16:57:58 +02:00
<!-- EDIT4 SECTION "Configuration" [1009 - 1035] -->
< h3 class = "sectionedit5" id = "mediwiki_local_configuration" > MediWiki local configuration< / h3 >
2012-02-25 23:45:20 +01:00
< div class = "level3" >
< p >
Then edit MediaWiki local settings
< / p >
2015-06-08 16:57:58 +02:00
< pre class = "code" > vi LocalSettings.php< / pre >
2012-02-25 23:45:20 +01:00
< pre class = "code file php" > < a href = "http://www.php.net/session_start" > < span class = "kw3" > session_start< / span > < / a > < span class = "br0" > ( < / span > < span class = "br0" > ) < / span > < span class = "sy0" > ;< / span >
< span class = "re0" > $_SERVER< / span > < span class = "br0" > [ < / span > < span class = "st_h" > 'PHP_AUTH_USER'< / span > < span class = "br0" > ] < / span > < span class = "sy0" > =< / span > < span class = "re0" > $_SERVER< / span > < span class = "br0" > [ < / span > < span class = "st_h" > 'REMOTE_USER'< / span > < span class = "br0" > ] < / span > < span class = "sy0" > ;< / span >
< span class = "kw1" > if< / span > < span class = "br0" > ( < / span > < span class = "br0" > ( < / span > < span class = "sy0" > !< / span > < a href = "http://www.php.net/empty" > < span class = "kw3" > empty< / span > < / a > < span class = "br0" > ( < / span > < span class = "re0" > $_SERVER< / span > < span class = "br0" > [ < / span > < span class = "st_h" > 'PHP_AUTH_USER'< / span > < span class = "br0" > ] < / span > < span class = "br0" > ) < / span > < span class = "sy0" > & & < / span > < span class = "sy0" > !< / span > < a href = "http://www.php.net/empty" > < span class = "kw3" > empty< / span > < / a > < span class = "br0" > ( < / span > < span class = "re0" > $_SERVER< / span > < span class = "br0" > [ < / span > < span class = "st_h" > 'REMOTE_USER'< / span > < span class = "br0" > ] < / span > < span class = "br0" > ) < / span > < span class = "br0" > ) < / span > < span class = "sy0" > ||< / span > < span class = "re0" > $_COOKIE< / span > < span class = "br0" > [ < / span > < span class = "re0" > $wgDBserver< / span > < span class = "sy0" > .< / span > < span class = "st_h" > 'UserID'< / span > < span class = "br0" > ] < / span > < span class = "br0" > ) < / span > < span class = "br0" > { < / span >
< span class = "kw1" > require_once< / span > < span class = "br0" > ( < / span > < span class = "st0" > " < span class = "es4" > $IP< / span > /extensions/HttpAuthPlugin.php" < / span > < span class = "br0" > ) < / span > < span class = "sy0" > ;< / span >
< span class = "re0" > $wgAuth< / span > < span class = "sy0" > =< / span > < span class = "kw2" > new< / span > HttpAuthPlugin< span class = "br0" > ( < / span > < span class = "br0" > ) < / span > < span class = "sy0" > ;< / span >
< span class = "co2" > # For MediaWiki < 1.13
< / span > < span class = "re0" > $wgHooks< / span > < span class = "br0" > [ < / span > < span class = "st_h" > 'AutoAuthenticate'< / span > < span class = "br0" > ] < / span > < span class = "br0" > [ < / span > < span class = "br0" > ] < / span > < span class = "sy0" > =< / span > < a href = "http://www.php.net/array" > < span class = "kw3" > array< / span > < / a > < span class = "br0" > ( < / span > < span class = "re0" > $wgAuth< / span > < span class = "sy0" > ,< / span > < span class = "st_h" > 'autoAuthenticate'< / span > < span class = "br0" > ) < / span > < span class = "sy0" > ;< / span >
< span class = "co2" > # For MediaWiki > = 1.13
< / span > < span class = "co2" > #$wgHooks['UserLoadFromSession'][] = array($wgAuth,'autoAuthenticate');
< / span > < span class = "br0" > } < / span > < / pre >
< / div >
2015-06-08 16:57:58 +02:00
<!-- EDIT5 SECTION "MediWiki local configuration" [1036 - 1672] -->
< h3 class = "sectionedit6" id = "mediawiki_virtual_host_in_apache" > MediaWiki virtual host in Apache< / h3 >
2012-02-25 23:45:20 +01:00
< div class = "level3" >
< p >
2015-12-18 10:46:34 +01:00
Configure MediaWiki virtual host like other < a href = "../../../documentation/1.9/configvhost.html" class = "wikilink1" title = "documentation:1.9:configvhost" > protected virtual host< / a > .
2012-02-25 23:45:20 +01:00
< / p >
2015-06-08 16:57:58 +02:00
< pre class = "code file apache" > < < span class = "kw3" > VirtualHost< / span > *:< span class = "nu0" > 80< / span > >
2012-02-25 23:45:20 +01:00
< span class = "kw1" > ServerName< / span > mediawiki.example.com
2014-05-22 11:58:26 +02:00
PerlHeaderParserHandler Lemonldap::NG::Handler
2012-02-25 23:45:20 +01:00
...
< /< span class = "kw3" > VirtualHost< / span > > < / pre >
< p >
2015-12-18 10:46:34 +01:00
< p > < div class = "noteimportant" > If you are protecting MediaWiki with < abbr title = "LemonLDAP::NG" > LL::NG< / abbr > as reverse proxy, < a href = "../../../documentation/1.9/header_remote_user_conversion.html" class = "wikilink1" title = "documentation:1.9:header_remote_user_conversion" > convert header into REMOTE_USER environment variable< / a > .
2012-02-25 23:45:20 +01:00
< / div > < / p >
< / p >
< / div >
2015-06-08 16:57:58 +02:00
<!-- EDIT6 SECTION "MediaWiki virtual host in Apache" [1673 - 2151] -->
< h3 class = "sectionedit7" id = "mediawiki_virtual_host_in_manager" > MediaWiki virtual host in Manager< / h3 >
2012-02-25 23:45:20 +01:00
< div class = "level3" >
< p >
2015-12-18 10:46:34 +01:00
Go to the Manager and < a href = "../../../documentation/1.9/configvhost.html#lemonldapng_configuration" class = "wikilink1" title = "documentation:1.9:configvhost" > create a new virtual host< / a > for MediaWiki.
2012-02-25 23:45:20 +01:00
< / p >
< p >
2015-12-18 10:46:34 +01:00
Just configure the < a href = "../../../documentation/1.9/writingrulesand_headers.html#rules" class = "wikilink1" title = "documentation:1.9:writingrulesand_headers" > access rules< / a > . You can also add a rule for logout:
2012-02-25 23:45:20 +01:00
< / p >
2015-06-08 16:57:58 +02:00
< pre class = "code" > Userlogout => logout_sso< / pre >
2012-02-25 23:45:20 +01:00
< p >
2015-12-18 10:46:34 +01:00
If using < abbr title = "LemonLDAP::NG" > LL::NG< / abbr > as reverse proxy, configure the < code > Auth-User< / code > < a href = "../../../documentation/1.9/writingrulesand_headers.html#headers" class = "wikilink1" title = "documentation:1.9:writingrulesand_headers" > header< / a > , else no headers are needed.
2012-02-25 23:45:20 +01:00
< / p >
< / div >
2015-06-08 16:57:58 +02:00
< / div > <!-- closes <div class="dokuwiki export"> -->