0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<?xml version="1.0" encoding="ISO-8859-1"?>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr"><head>
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd<!--
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor This file is generated from xml source: DO NOT EDIT
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor -->
96ad5d81ee4a2cc66a4ae19893efc8aa6d06fae7jailletc<title>mod_authz_dbd - Serveur Apache HTTP Version 2.5</title>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="/style/css/prettify.css" />
2e545ce2450a9953665f701bb05350f0d3f26275nd<script src="/style/scripts/prettify.min.js" type="text/javascript">
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor</script>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<link href="/images/favicon.ico" rel="shortcut icon" /></head>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<body>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<div id="page-header">
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossaire</a> | <a href="/sitemap.html">Plan du site</a></p>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<p class="apache">Serveur Apache HTTP Version 2.5</p>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<img alt="" src="/images/feather.gif" /></div>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="/images/left.gif" /></a></div>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<div id="path">
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">Serveur HTTP</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.5</a> &gt; <a href="./">Modules</a></div>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<div id="page-content">
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<div id="preamble"><h1>Module Apache mod_authz_dbd</h1>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<div class="toplang">
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<p><span>Langues Disponibles: </span><a href="/en/mod/mod_authz_dbd.html" hreflang="en" rel="alternate" title="English">&nbsp;en&nbsp;</a> |
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<a href="/fr/mod/mod_authz_dbd.html" title="Fran�ais">&nbsp;fr&nbsp;</a></p>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor</div>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Autorisation par groupe ou par identifiant via SQL</td></tr>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<tr><th><a href="module-dict.html#Status">Statut:</a></th><td>Extension</td></tr>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<tr><th><a href="module-dict.html#ModuleIdentifier">Identificateur�de�Module:</a></th><td>authz_dbd_module</td></tr>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<tr><th><a href="module-dict.html#SourceFile">Fichier�Source:</a></th><td>mod_authz_dbd.c</td></tr>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<tr><th><a href="module-dict.html#Compatibility">Compatibilit�:</a></th><td>Disponible dans les version 2.4 et sup�rieures
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzord'Apache</td></tr></table>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<h3>Sommaire</h3>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <p>Ce module fournit des fonctionnalit�s d'autorisation permettant
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor d'accorder ou de refuser aux utilisateurs authentifi�s l'acc�s �
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor certaines zones du site web en fonction de leur appartenance � tel
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor ou tel groupe. Les modules <code class="module"><a href="/mod/mod_authz_groupfile.html">mod_authz_groupfile</a></code> et
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <code class="module"><a href="/mod/mod_authz_dbm.html">mod_authz_dbm</a></code> fournissent une fonctionnalit�
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor similaire, mais ici le module interroge une base de donn�es SQL pour
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor d�terminer si un utilisateur appartient ou non � tel ou tel groupe.</p>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <p>Ce module peut aussi fournir des fonctionnalit�s de connexion
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor utilisateur s'appuyant sur une base de donn�es. Ceci prend le plus souvent
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor sens lorsque le module est utilis� conjointement avec
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <code class="module"><a href="/mod/mod_authn_dbd.html">mod_authn_dbd</a></code>.</p>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <p>Ce module s'appuie sur <code class="module"><a href="/mod/mod_dbd.html">mod_dbd</a></code> pour sp�cifier le
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor pilote de la base de donn�es sous-jacente et les param�tres de
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor connexion, et g�rer les connexions � la base de donn�es.</p>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor</div>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<div id="quickview"><h3>Sujets</h3>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<ul id="topics">
01f52ba6a87aa39d3873a441369828875c471823trawick<li><img alt="" src="/images/down.gif" /> <a href="#requiredirectives">Les directives Require</a></li>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<li><img alt="" src="/images/down.gif" /> <a href="#login">Connexion s'appuyant sur une base de donn�es</a></li>
fb9422f3bdba0c01312e22a55864dcc056583b7cgryzor<li><img alt="" src="/images/down.gif" /> <a href="#client">Int�gration des ouvertures de sessions c�t� client</a></li>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<li><img alt="" src="/images/down.gif" /> <a href="#example">Exemple de configuration</a></li>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<li><img alt="" src="/images/down.gif" /> <a href="#security">Pr�vention contre les injections SQL</a></li>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar</ul><h3 class="directives">Directives</h3>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<ul id="toc">
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<li><img alt="" src="/images/down.gif" /> <a href="#authzdbdlogintoreferer">AuthzDBDLoginToReferer</a></li>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<li><img alt="" src="/images/down.gif" /> <a href="#authzdbdquery">AuthzDBDQuery</a></li>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<li><img alt="" src="/images/down.gif" /> <a href="#authzdbdredirectquery">AuthzDBDRedirectQuery</a></li>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar</ul>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<h3>Voir aussi</h3>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<ul class="seealso">
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<li><code class="directive"><a href="/mod/mod_authz_core.html#require">Require</a></code></li>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<li>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <code class="directive"><a href="/mod/mod_authn_dbd.html#authdbduserpwquery">AuthDBDUserPWQuery</a></code>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor</li>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<li><code class="directive"><a href="/mod/mod_dbd.html#dbdriver">DBDriver</a></code></li>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<li><code class="directive"><a href="/mod/mod_dbd.html#dbdparams">DBDParams</a></code></li>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor</ul><ul class="seealso"><li><a href="#comments_section">Commentaires</a></li></ul></div>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<div class="section">
01f52ba6a87aa39d3873a441369828875c471823trawick<h2><a name="requiredirectives" id="requiredirectives">Les directives Require</a></h2>
01f52ba6a87aa39d3873a441369828875c471823trawick
01f52ba6a87aa39d3873a441369828875c471823trawick <p>Les directives <code class="directive"><a href="/mod/mod_authz_core.html#require">Require</a></code> d'Apache permettent,
01f52ba6a87aa39d3873a441369828875c471823trawick au cours de la phase d'autorisation, de s'assurer qu'un utilisateur
01f52ba6a87aa39d3873a441369828875c471823trawick est bien autoris� � acc�der � une ressource. mod_authz_dbd ajoute
01f52ba6a87aa39d3873a441369828875c471823trawick les types d'autorisation <code>dbd-group</code>,
01f52ba6a87aa39d3873a441369828875c471823trawick <code>dbd-login</code> et <code>dbd-logout</code>.</p>
01f52ba6a87aa39d3873a441369828875c471823trawick
0237f43ab925775250e266e479d0a337ff374a4btakashi <p>A partir de la version 2.4.8, les directives require DBD
01f52ba6a87aa39d3873a441369828875c471823trawick supportent les <a href="/expr.html">expressions</a>.</p>
01f52ba6a87aa39d3873a441369828875c471823trawick
01f52ba6a87aa39d3873a441369828875c471823trawick<h3><a name="reqgroup" id="reqgroup">Require dbd-group</a></h3>
01f52ba6a87aa39d3873a441369828875c471823trawick
01f52ba6a87aa39d3873a441369828875c471823trawick <p>Cette directive permet de sp�cifier � quel groupe un utilisateur
01f52ba6a87aa39d3873a441369828875c471823trawick doit appartenir pour obtenir l'autorisation d'acc�s.</p>
01f52ba6a87aa39d3873a441369828875c471823trawick
4aa603e6448b99f9371397d439795c91a93637eand <pre class="prettyprint lang-config"> Require dbd-group team
4aa603e6448b99f9371397d439795c91a93637eand AuthzDBDQuery "SELECT group FROM authz WHERE user = %s"</pre>
01f52ba6a87aa39d3873a441369828875c471823trawick
01f52ba6a87aa39d3873a441369828875c471823trawick
01f52ba6a87aa39d3873a441369828875c471823trawick
01f52ba6a87aa39d3873a441369828875c471823trawick
01f52ba6a87aa39d3873a441369828875c471823trawick<h3><a name="reqlogin" id="reqlogin">Require dbd-login</a></h3>
01f52ba6a87aa39d3873a441369828875c471823trawick
01f52ba6a87aa39d3873a441369828875c471823trawick <p>Cette directive permet de sp�cifier une requ�te � ex�cuter pour
01f52ba6a87aa39d3873a441369828875c471823trawick indiquer que l'utilisateur s'est authentifi�.</p>
01f52ba6a87aa39d3873a441369828875c471823trawick
4aa603e6448b99f9371397d439795c91a93637eand <pre class="prettyprint lang-config"> Require dbd-login
4aa603e6448b99f9371397d439795c91a93637eand AuthzDBDQuery "UPDATE authn SET login = 'true' WHERE user = %s"</pre>
01f52ba6a87aa39d3873a441369828875c471823trawick
01f52ba6a87aa39d3873a441369828875c471823trawick
01f52ba6a87aa39d3873a441369828875c471823trawick
01f52ba6a87aa39d3873a441369828875c471823trawick
01f52ba6a87aa39d3873a441369828875c471823trawick<h3><a name="reqlogout" id="reqlogout">Require dbd-logout</a></h3>
01f52ba6a87aa39d3873a441369828875c471823trawick
01f52ba6a87aa39d3873a441369828875c471823trawick <p>Cette directive permet de sp�cifier une requ�te � ex�cuter pour
01f52ba6a87aa39d3873a441369828875c471823trawick indiquer que l'utilisateur s'est d�connect�.</p>
01f52ba6a87aa39d3873a441369828875c471823trawick
4aa603e6448b99f9371397d439795c91a93637eand <pre class="prettyprint lang-config"> Require dbd-logout
4aa603e6448b99f9371397d439795c91a93637eand AuthzDBDQuery "UPDATE authn SET login = 'false' WHERE user = %s"</pre>
01f52ba6a87aa39d3873a441369828875c471823trawick
01f52ba6a87aa39d3873a441369828875c471823trawick
01f52ba6a87aa39d3873a441369828875c471823trawick
01f52ba6a87aa39d3873a441369828875c471823trawick
01f52ba6a87aa39d3873a441369828875c471823trawick</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
01f52ba6a87aa39d3873a441369828875c471823trawick<div class="section">
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<h2><a name="login" id="login">Connexion s'appuyant sur une base de donn�es</a></h2>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<p>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzorOutre sa fonction d'autorisation standard consistant � v�rifier
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzorl'appartenance � des groupes, ce module permet �galement de g�rer des
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzorsessions utilisateur c�t� serveur gr�ce � sa fonctionnalit� de gestion de login/logout
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzorvia base de donn�es. En particulier, il peut mettre �
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzorjour le statut de session de l'utilisateur dans la base de donn�es
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzorchaque fois que celui-ci visite certaines URLs (sous r�serve bien
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzorentendu que l'utilisateur fournisse les informations de connexion
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzorn�cessaires).</p>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<p>Pour cela, il faut definir deux directives <code class="directive"><a href="/mod/mod_authz_core.html#require">Require</a></code> sp�ciales : <code>Require
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzordbd-login</code> et <code>Require dbd-logout</code>. Pour les d�tails de
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzorleur utilisation, voir l'exemple de configuration ci-dessous.</p>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<div class="section">
fb9422f3bdba0c01312e22a55864dcc056583b7cgryzor<h2><a name="client" id="client">Int�gration des ouvertures de sessions c�t� client</a></h2>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<p>Pour les administrateurs qui d�sirent impl�menter une gestion de
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzorsession c�t� client fonctionnant de concert avec les fonctionnalit�s de
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzorconnexion/d�connexion c�t� serveur offertes par ce module, il est possible
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzorde d�finir ou en d'annuler par exemple un cookie HTTP ou un jeton
fb9422f3bdba0c01312e22a55864dcc056583b7cgryzorde connextion lorsqu'un utilisateur se connecte ou se d�connecte.</p>
fb9422f3bdba0c01312e22a55864dcc056583b7cgryzor<p> Pour supporter une telle int�gration, <code class="module"><a href="/mod/mod_authz_dbd.html">mod_authz_dbd</a></code> exporte
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzorun d�clenchement optionnel (hook) qui sera lanc� chaque fois
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzorque le statut d'un utilisateur sera mis � jour dans la base de donn�es.
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzorD'autres modules de gestion de session pourront alors utiliser ce
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzord�clencheur pour utiliser des fonctions d'ouverture et de
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzorfermeture de sessions c�t� client.</p>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<div class="section">
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<h2><a name="example" id="example">Exemple de configuration</a></h2>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
4aa603e6448b99f9371397d439795c91a93637eand<pre class="prettyprint lang-config"># configuration de mod_dbd
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzorDBDriver pgsql
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzorDBDParams "dbname=apacheauth user=apache pass=xxxxxx"
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzorDBDMin 4
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzorDBDKeep 8
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzorDBDMax 20
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzorDBDExptime 300
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
853ab6827637acc5cdd976cd2ea20a18f82ae184lgentis&lt;Directory "/usr/www/mon.site/team-private/"&gt;
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor # configuration de mod_authn_core et mod_auth_basic
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor # pour mod_authn_dbd
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor AuthType Basic
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor AuthName Team
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor AuthBasicProvider dbd
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor # requ�te SQL de mod_authn_dbd pour authentifier un utilisateur qui se
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor # connecte
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor AuthDBDUserPWQuery \
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor "SELECT password FROM authn WHERE user = %s AND login = 'true'"
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor # configuration de mod_authz_core pour mod_authz_dbd
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor Require dbd-group team
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor # configuration de mod_authz_dbd
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor AuthzDBDQuery "SELECT group FROM authz WHERE user = %s"
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor # lorsqu'un utilisateur �choue dans sa tentative d'authentification ou
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor # d'autorisation, on l'invite � se connecter ; cette page doit
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor # contenir un lien vers /team-private/login.html
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor ErrorDocument 401 /login-info.html
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
853ab6827637acc5cdd976cd2ea20a18f82ae184lgentis &lt;Files "login.html"&gt;
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor # il n'est pas n�cessaire que l'utilisateur soit d�j� connect� !
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor AuthDBDUserPWQuery "SELECT password FROM authn WHERE user = %s"
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor # le processus de connexion dbd ex�cute une requ�te pour enregistrer
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor # la connexion de l'utilisateur
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor Require dbd-login
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor AuthzDBDQuery "UPDATE authn SET login = 'true' WHERE user = %s"
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor # redirige l'utilisateur vers la page d'origine (si elle existe)
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor # apr�s une connexion r�ussie
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor AuthzDBDLoginToReferer On
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor &lt;/Files&gt;
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
853ab6827637acc5cdd976cd2ea20a18f82ae184lgentis &lt;Files "logout.html"&gt;
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor # le processus de d�connexion dbd ex�cute une requ�te pour
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor # enregistrer la d�connexion de l'utilisateur
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor Require dbd-logout
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor AuthzDBDQuery "UPDATE authn SET login = 'false' WHERE user = %s"
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor &lt;/Files&gt;
4aa603e6448b99f9371397d439795c91a93637eand&lt;/Directory&gt;</pre>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<div class="section">
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<h2><a name="security" id="security">Pr�vention contre les injections SQL</a></h2>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <p>Selon le pilote DBD choisi et le serveur d'arri�re-plan que vous utilisez,
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor vous devrez prendre garde � la s�curit� dans le domaine SQL.
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor Avec la plupart des pilotes, vous n'avez rien � faire : la
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor requ�te est pr�par�e par la base de donn�es au d�marrage, et l'entr�e
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor utilisateur n'est utilis�e qu'en tant que donn�e. Mais vous aurez
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor peut-�tre � nettoyer cette entr�e. Au moment o� ces lignes sont
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor �crites, le seul pilote DBD qui peut n�cessiter le nettoyage de l'entr�e
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor est FreeTDS.</p>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <p>Veuillez vous r�f�rez � la documentation de
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <code class="module"><a href="/mod/mod_dbd.html">mod_dbd</a></code> pour plus d'informations � propos de la
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor s�curit� dans ce domaine.</p>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor</div>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<div class="directive-section"><h2><a name="authzdbdlogintoreferer" id="authzdbdlogintoreferer">Directive</a> <a name="AuthzDBDLoginToReferer" id="AuthzDBDLoginToReferer">AuthzDBDLoginToReferer</a></h2>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<table class="directive">
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>D�finit si le client doit �tre redirig� vers la page
1f1b6bf13313fdd14a45e52e553d3ff28689b717coard'origine en cas de connexion ou de d�connexion r�ussie si une en-t�te
1f1b6bf13313fdd14a45e52e553d3ff28689b717coarde requ�te <code>Referer</code> est pr�sente</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Syntax">Syntaxe:</a></th><td><code>AuthzDBDLoginToReferer On|Off</code></td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Default">D�faut:</a></th><td><code>AuthzDBDLoginToReferer Off</code></td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Context">Contexte:</a></th><td>r�pertoire</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Status">Statut:</a></th><td>Extension</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_authz_dbd</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar</table>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>Utilis�e en conjonction avec <code>Require dbd-login</code> ou
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code>Require dbd-logout</code>, cette directive permet de rediriger
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar le client vers la page d'origine (l'URL contenue dans l'en-t�te
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar de requ�te HTTP <code>Referer</code>, s'il est pr�sent). En
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar l'absence d'en-t�te <code>Referer</code>, la d�finition
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code>AuthzDBDLoginToReferer On</code> sera ignor�e.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar</div>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<div class="directive-section"><h2><a name="authzdbdquery" id="authzdbdquery">Directive</a> <a name="AuthzDBDQuery" id="AuthzDBDQuery">AuthzDBDQuery</a></h2>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<table class="directive">
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>D�finit la requ�te SQL pour l'op�ration
1f1b6bf13313fdd14a45e52e553d3ff28689b717coarrequise</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Syntax">Syntaxe:</a></th><td><code>AuthzDBDQuery <var>requ�te</var></code></td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Context">Contexte:</a></th><td>r�pertoire</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Status">Statut:</a></th><td>Extension</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_authz_dbd</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar</table>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>La directive <code class="directive">AuthzDBDQuery</code> permet de
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar sp�cifier une requ�te SQL � ex�cuter. Le but de cette requ�te d�pend
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar de la directive <code class="directive"><a href="/mod/mod_authz_core.html#require">Require</a></code> en cours de
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar traitement.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <ul>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <li>Avec la directive <code>Require dbd-group</code>, elle sp�cifie
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar une requ�te permettant de rechercher les groupes d'appartenance de
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar l'utilisateur courant. Ceci correspond � la fonctionnalit� standard
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar d'autres modules d'autorisation comme
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code class="module"><a href="/mod/mod_authz_groupfile.html">mod_authz_groupfile</a></code> et
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code class="module"><a href="/mod/mod_authz_dbm.html">mod_authz_dbm</a></code>.
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar La premi�re colonne de chaque enregistrement renvoy� par la requ�te
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar doit contenir une cha�ne de caract�res correspondant � un nom de
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar groupe. La requ�te peut renvoyer z�ro, un ou plusieurs
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar enregistrements.
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <pre class="prettyprint lang-config">Require dbd-group
1f1b6bf13313fdd14a45e52e553d3ff28689b717coarAuthzDBDQuery "SELECT group FROM groups WHERE user = %s"</pre>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar </li>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <li>Avec la directive <code>Require dbd-login</code> ou
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <code>Require dbd-logout</code>, elle ne refusera jamais l'acc�s,
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar mais au contraire ex�cutera une requ�te SQL permettant d'enregistrer
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar la connexion ou la d�connexion de l'utilisateur. Ce dernier doit
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar �tre d�j� authentifi� avec <code class="module"><a href="/mod/mod_authn_dbd.html">mod_authn_dbd</a></code>.
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <pre class="prettyprint lang-config">Require dbd-login
1f1b6bf13313fdd14a45e52e553d3ff28689b717coarAuthzDBDQuery "UPDATE authn SET login = 'true' WHERE user = %s"</pre>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar </li>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar </ul>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>Dans tous les cas, l'identifiant utilisateur sera transmis comme
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar param�tre sous la forme d'une simple cha�ne lorsque la requ�te SQL
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar sera ex�cut�e. Il y sera fait r�f�rence dans la requ�te en utilisant
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar le sp�cificateur de format <code>%s</code>.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar</div>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<div class="directive-section"><h2><a name="authzdbdredirectquery" id="authzdbdredirectquery">Directive</a> <a name="AuthzDBDRedirectQuery" id="AuthzDBDRedirectQuery">AuthzDBDRedirectQuery</a></h2>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<table class="directive">
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>D�finit une requ�te pour rechercher une page vers laquelle
1f1b6bf13313fdd14a45e52e553d3ff28689b717coarrediriger l'utilisateur apr�s une connexion r�ussie</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Syntax">Syntaxe:</a></th><td><code>AuthzDBDRedirectQuery <var>requ�te</var></code></td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Context">Contexte:</a></th><td>r�pertoire</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Status">Statut:</a></th><td>Extension</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_authz_dbd</td></tr>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar</table>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>Sp�cifie une requ�te SQL optionnelle � utiliser apr�s une
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar connexion (ou une d�connexion) r�ussie pour rediriger l'utilisateur
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar vers une URL, qui peut �tre sp�cifique � l'utilisateur.
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar L'identifiant utilisateur sera transmis comme param�tre sous la
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar forme d'une simple cha�ne lorsque la requ�te SQL sera ex�cut�e. Il y
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar sera fait r�f�rence dans la requ�te en utilisant le sp�cificateur de
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar format <code>%s</code>.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <pre class="prettyprint lang-config">AuthzDBDRedirectQuery "SELECT userpage FROM userpages WHERE user = %s"</pre>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>La premi�re colonne du premier enregistrement renvoy� par la
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar requ�te doit contenir une cha�ne de caract�res correspondant � une
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar URL vers laquelle rediriger le client. Les enregistrements suivants
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar sont ignor�s. Si aucun enregistrement n'est renvoy�, le client ne
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar sera pas redirig�.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <p>Notez que <code class="directive">AuthzDBDLoginToReferer</code> l'emporte
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar sur cette directive si les deux sont d�finies.</p>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar</div>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor</div>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<div class="bottomlang">
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<p><span>Langues Disponibles: </span><a href="/en/mod/mod_authz_dbd.html" hreflang="en" rel="alternate" title="English">&nbsp;en&nbsp;</a> |
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<a href="/fr/mod/mod_authz_dbd.html" title="Fran�ais">&nbsp;fr&nbsp;</a></p>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor</div><div class="top"><a href="#page-header"><img src="/images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Commentaires</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<script type="text/javascript"><!--//--><![CDATA[//><!--
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzorvar comments_shortname = 'httpd';
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzorvar comments_identifier = 'http://httpd.apache.org/docs/trunk/mod/mod_authz_dbd.html';
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor(function(w, d) {
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor d.write('<div id="comments_thread"><\/div>');
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor var s = d.createElement('script');
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor s.type = 'text/javascript';
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor s.async = true;
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor }
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor else {
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor }
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor})(window, document);
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor//--><!]]></script></div><div id="footer">
205f749042ed530040a4f0080dbcb47ceae8a374rjung<p class="apache">Copyright 2015 The Apache Software Foundation.<br />Autoris� sous <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossaire</a> | <a href="/sitemap.html">Plan du site</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzorif (typeof(prettyPrint) !== 'undefined') {
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor prettyPrint();
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor}
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor//--><!]]></script>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor</body></html>