lemonldap-ng/build/lemonldap-ng/doc/5-Appli-MediaWiki.html

185 lines
5.7 KiB
HTML

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr">
<head>
<meta name="generator" content=
"HTML Tidy for Linux/x86 (vers 25 March 2009), see www.w3.org" />
<title>Lemonldap::NG documentation: 5-Appli-MediaWiki.html</title>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
<style type="text/css">
/*<![CDATA[*/
body{
background: #ddd;
font-family: sans-serif;
font-size: 11pt;
padding: 0 50px;
}
div.main-content{
padding: 10px;
background: #fff;
border: 2px #ccc solid;
}
a{
text-decoration: none;
}
p.footer{
text-align: center;
margin: 5px 0 0 0;
}
.heading-1{
text-align: center;
color: orange;
font-variant: small-caps;
font-size: 20pt;
}
.heading-1-1{
color: orange;
font-size: 14pt;
border-bottom: 2px #ccc solid;
}
pre{
background: #eee;
border: 2px #ccc solid;
padding: 5px;
border-left: 10px #ccc solid;
}
ul.star li{
list-style-type: square;
}
/*]]>*/
</style>
</head>
<body>
<div class="main-content">
<h2 class="heading-1"><span id="HMediaWiki">MediaWiki</span></h2>
<p class="paragraph"></p>
<ul>
<li><a href="#HPresentation">Presentation</a></li>
<li>
<a href="#HIntegrationwithLemonLDAP3A3ANG">Integration with
LemonLDAP::NG</a>
<ul>
<li><a href="#HInstallextensiononMediaWiki">Install extension on
MediaWiki</a></li>
<li><a href="#HConfigureLemonLDAP3A3ANG">Configure
LemonLDAP::NG</a></li>
</ul>
</li>
</ul>
<h3 class="heading-1-1"><span id="HPresentation">Presentation</span></h3>
<p class="paragraph"></p><span class="wikiexternallink"><a href=
"http://www.mediawiki.org">MediaWiki</a></span> is a wiki software, used
by the well known <span class="wikiexternallink"><a href=
"http://www.wikipedia.org">Wikipedia</a></span>.
<p class="paragraph"></p>Several extensions allows to configure SSO on
MediaWiki:
<ul class="star">
<li><span class="nobr"><a href=
"http://www.mediawiki.org/wiki/Extension:AutomaticREMOTE_USER">http://www.mediawiki.org/wiki/Extension:AutomaticREMOTE_USER</a></span></li>
<li><span class="nobr"><a href=
"http://www.mediawiki.org/wiki/Extension:Siteminder_Authentication">http://www.mediawiki.org/wiki/Extension:Siteminder_Authentication</a></span></li>
<li><span class="nobr"><a href=
"http://www.mediawiki.org/wiki/Extension:HttpAuth">http://www.mediawiki.org/wiki/Extension:HttpAuth</a></span></li>
</ul>We will explain how to use the latest: HttpAuth.
<h3 class="heading-1-1"><span id=
"HIntegrationwithLemonLDAP3A3ANG">Integration with
LemonLDAP::NG</span></h3>
<h4 class="heading-1-1-1"><span id="HInstallextensiononMediaWiki">Install
extension on MediaWiki</span></h4>
<p class="paragraph"></p>The extension is presented here: <span class=
"nobr"><a href=
"http://www.mediawiki.org/wiki/Extension:HttpAuth">http://www.mediawiki.org/wiki/Extension:HttpAuth</a></span>
<p class="paragraph"></p>You can download the code here: <span class=
"nobr"><a href=
"http://github.com/oremj/mediawiki-http-auth/downloads">http://github.com/oremj/mediawiki-http-auth/downloads</a></span>
<p class="paragraph"></p>You have to install <strong class=
"strong">HttpAuthPlugin.php</strong> in the <strong class=
"strong">extensions/</strong> directory of your MediaWiki installation,
and then edit <strong class="strong">LocalSettings.php</strong>:
<p class="paragraph"></p>
<div class="code">
<pre>
session_start();
$_SERVER['PHP_AUTH_USER'] = $_SERVER['REMOTE_USER'];
<span class=
"java-keyword">if</span> ((!empty($_SERVER['PHP_AUTH_USER']) &amp;&amp; !empty($_SERVER['REMOTE_USER'])) || $_COOKIE[$wgDBserver . 'UserID']) {
require_once(<span class=
"java-quote">"$IP/extensions/HttpAuthPlugin.php"</span>);
$wgAuth = <span class="java-keyword">new</span> HttpAuthPlugin();
$wgHooks['AutoAuthenticate'][] = array($wgAuth,'autoAuthenticate');
}
</pre>
</div>
<h4 class="heading-1-1-1"><span id="HConfigureLemonLDAP3A3ANG">Configure
LemonLDAP::NG</span></h4>
<p class="paragraph"></p>Declare a VirtualHost in Apache for MediaWiki and
active SSO, for example:
<p class="paragraph"></p>
<div class="code">
<pre>
&lt;VirtualHost *&gt;
ServerName mediawiki.example.com<br /><br /> # SSO protection
PerlHeaderParserHandler My::Package<br /><br /> # DocumentRoot
DocumentRoot /<span class="java-keyword">var</span>/www/html/mediawiki/
DirectoryIndex index.php<br /><br /> LogLevel warn
ErrorLog /<span class=
"java-keyword">var</span>/log/httpd/mediawiki-error.log
CustomLog /<span class=
"java-keyword">var</span>/log/httpd/mediawiki-access.log combined
&lt;/VirtualHost&gt;
</pre>
</div>
<p class="paragraph"></p>Then add this host in LemonLDAP::NG
Manager.<br />
<br />
If you are using LemonLDAP::NG as proxy, you can use this in your
MediaWiki Apache configuration:<br />
<br />
<div class="code">
<pre>
SetEnvIfNoCase Auth-User <span class="java-quote">"(.*)"</span> REMOTE_USER=$1
</pre>
</div><br />
<br />
You can also catch the logout page with this rule:<br />
<br />
<div class="code">
<pre>
Userlogout =&gt; logout_app_sso
</pre>
</div>
</div>
<p class="footer"><a href="index.html">Index</a></p>
</body>
</html>