93 lines
4.3 KiB
HTML
93 lines
4.3 KiB
HTML
|
||
<!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="fr"
|
||
lang="fr" dir="ltr">
|
||
|
||
<head>
|
||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||
<title></title><!-- metadata --><!-- style sheet links -->
|
||
|
||
<meta name="generator" content="Hors ligne" />
|
||
<meta name="version" content="Hors-ligne 0.1" />
|
||
|
||
<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">
|
||
|
||
|
||
<h1 class="sectionedit1" id="http_basic_authentication">Authentification basique HTTP</h1>
|
||
<div class="level1">
|
||
|
||
<p>
|
||
<a href="/_detail/applications/http_logo.png?id=documentation%3A1.9%3Aapplications%3Aauthbasic" class="media" title="applications:http_logo.png"><img src="../../../../media/applications/http_logo.png" class="mediacenter" alt="" /></a>
|
||
</p>
|
||
|
||
</div><!-- EDIT1 SECTION "HTTP Basic Authentication" [1-77] -->
|
||
|
||
<h2 class="sectionedit2" id="presentation">Présentation</h2>
|
||
<div class="level2">
|
||
|
||
<p>
|
||
Extrait de <a href="http://fr.wikipedia.org/wiki/HTTP_Authentification" class="urlextern" title="http://fr.wikipedia.org/wiki/HTTP_Authentification" rel="nofollow">l'article Wikipedia</a>:
|
||
</p>
|
||
|
||
<p>
|
||
</p><blockquote>
|
||
|
||
In the context of an HTTP transaction, the basic access authentication is a method designed to allow a web browser, or other client program, to provide credentials – in the form of a user name and password – when making a request.
|
||
|
||
</p>
|
||
|
||
<p>
|
||
Avant la transmission, le nom et le mot de passe sont encodés en base-64. Par exemple, le nom Aladdin et le mot-de-passe "open sesame" vont être assemblés en "Aladdin:open sesame" – dont l'équivalent est QWxhZGRpbjpvcGVuIHNlc2FtZQ== en Base64. Un petit effort est requis pour décoder ces chaînes et de nombreux outils de sécurité les décodent à la volée.
|
||
</blockquote>
|
||
</p>
|
||
|
||
<p>
|
||
|
||
So HTTP Basic Autentication is managed trough an HTTP header (<code>Authorization</code>), that can be forged by <abbr title="LemonLDAP::NG">LL::NG</abbr>, with this precautions:
|
||
|
||
</p>
|
||
<ul>
|
||
<li class="level1"><div class="li"> Data should not contains accents or special characters, as HTTP protocol only allow <abbr title="American Standard Code for Information Interchange">ASCII</abbr> values in header (but depending on the HTTP server, you can use ISO encoded values)</div>
|
||
</li>
|
||
<li class="level1"><div class="li"> Il est nécessaire d'exporter le mot-de-passe, qui peut être le mot-de-passe principal de l'utilisateur (si <a href="../../../documentation/1.9/passwordstore.html" class="wikilink1" title="documentation:1.9:passwordstore">le mot-de-passe est stocké dans la session</a>, ou n'importe quel attribut utilisateur (si d'autres mots-de-passe sont stockés dans la base de données des utilisateurs).</div>
|
||
</li>
|
||
</ul>
|
||
|
||
</div><!-- EDIT2 SECTION "Presentation" [78-1452] -->
|
||
|
||
<h2 class="sectionedit3" id="configuration">Configuration</h2>
|
||
<div class="level2">
|
||
|
||
<p>
|
||
The Basic Authentication relies on a specific HTTP header, as described above. Il suffit donc de déclarer cet en-tête pour l'hôte virtuel dans le manager.
|
||
</p>
|
||
|
||
<p>
|
||
Par exemple, pour exporter l'identifiant (<code>$uid</code>) et le mot-de-passe (<code>$_password</code> si <a href="../../../documentation/1.9/passwordstore.html" class="wikilink1" title="documentation:1.9:passwordstore">le mot-de-passe est stocké dans la session</a>):
|
||
</p>
|
||
<pre class="code">Authorization => "Basic ".encode_base64("$uid:$_password")</pre>
|
||
|
||
<p>
|
||
<abbr title="LemonLDAP::NG">LL::NG</abbr> fournit une fonction spéciale nommée <a href="../../../documentation/1.9/extendedfunctions.html#basic" class="wikilink1" title="documentation:1.9:extendedfunctions">basic</a> pour construire cet en-tête.
|
||
</p>
|
||
|
||
<p>
|
||
Ainsi l'exemple ci-dessous peut être écrit simplement :
|
||
</p>
|
||
<pre class="code">Authorization => basic($uid,$_password)</pre>
|
||
|
||
<p>
|
||
</p><p></p><div class="notetip">The <code>basic</code> function will also force conversion from UTF-8 to ISO-8859-1, which should be accepted by most of HTTP servers.
|
||
|
||
</div></p>
|
||
</p>
|
||
|
||
</div>
|
||
</div><!-- closes <div class="dokuwiki export">--></body></html> |