diff options
Diffstat (limited to '')
-rw-r--r-- | docs/manual/mod/mod_authz_dbd.html | 9 | ||||
-rw-r--r-- | docs/manual/mod/mod_authz_dbd.html.en | 315 | ||||
-rw-r--r-- | docs/manual/mod/mod_authz_dbd.html.fr.utf8 | 334 |
3 files changed, 658 insertions, 0 deletions
diff --git a/docs/manual/mod/mod_authz_dbd.html b/docs/manual/mod/mod_authz_dbd.html new file mode 100644 index 0000000..b2ee0f9 --- /dev/null +++ b/docs/manual/mod/mod_authz_dbd.html @@ -0,0 +1,9 @@ +# GENERATED FROM XML -- DO NOT EDIT + +URI: mod_authz_dbd.html.en +Content-Language: en +Content-type: text/html; charset=ISO-8859-1 + +URI: mod_authz_dbd.html.fr.utf8 +Content-Language: fr +Content-type: text/html; charset=UTF-8 diff --git a/docs/manual/mod/mod_authz_dbd.html.en b/docs/manual/mod/mod_authz_dbd.html.en new file mode 100644 index 0000000..4176900 --- /dev/null +++ b/docs/manual/mod/mod_authz_dbd.html.en @@ -0,0 +1,315 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!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="en" xml:lang="en"><head> +<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" /> +<!-- + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + This file is generated from xml source: DO NOT EDIT + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + --> +<title>mod_authz_dbd - Apache HTTP Server Version 2.4</title> +<link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> +<link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> +<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" /> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> +</script> + +<link href="../images/favicon.ico" rel="shortcut icon" /></head> +<body> +<div id="page-header"> +<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p> +<p class="apache">Apache HTTP Server Version 2.4</p> +<img alt="" src="../images/feather.png" /></div> +<div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div> +<div id="path"> +<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.4</a> > <a href="./">Modules</a></div> +<div id="page-content"> +<div id="preamble"><h1>Apache Module mod_authz_dbd</h1> +<div class="toplang"> +<p><span>Available Languages: </span><a href="../en/mod/mod_authz_dbd.html" title="English"> en </a> | +<a href="../fr/mod/mod_authz_dbd.html" hreflang="fr" rel="alternate" title="Français"> fr </a></p> +</div> +<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Group Authorization and Login using SQL</td></tr> +<tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr> +<tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>authz_dbd_module</td></tr> +<tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_authz_dbd.c</td></tr> +<tr><th><a href="module-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.4 and later</td></tr></table> +<h3>Summary</h3> + + <p>This module provides authorization capabilities so that + authenticated users can be allowed or denied access to portions + of the web site by group membership. Similar functionality is + provided by <code class="module"><a href="../mod/mod_authz_groupfile.html">mod_authz_groupfile</a></code> and + <code class="module"><a href="../mod/mod_authz_dbm.html">mod_authz_dbm</a></code>, with the exception that + this module queries a SQL database to determine whether a + user is a member of a group.</p> + <p>This module can also provide database-backed user login/logout + capabilities. These are likely to be of most value when used + in conjunction with <code class="module"><a href="../mod/mod_authn_dbd.html">mod_authn_dbd</a></code>.</p> + <p>This module relies on <code class="module"><a href="../mod/mod_dbd.html">mod_dbd</a></code> to specify + the backend database driver and connection parameters, and + manage the database connections.</p> +</div> +<div id="quickview"><a href="https://www.apache.org/foundation/contributing.html" class="badge"><img src="https://www.apache.org/images/SupportApache-small.png" alt="Support Apache!" /></a><h3>Topics</h3> +<ul id="topics"> +<li><img alt="" src="../images/down.gif" /> <a href="#requiredirectives">The Require Directives</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#login">Database Login</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#client">Client Login integration</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#example">Configuration example</a></li> +</ul><h3 class="directives">Directives</h3> +<ul id="toc"> +<li><img alt="" src="../images/down.gif" /> <a href="#authzdbdlogintoreferer">AuthzDBDLoginToReferer</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#authzdbdquery">AuthzDBDQuery</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#authzdbdredirectquery">AuthzDBDRedirectQuery</a></li> +</ul> +<h3>Bugfix checklist</h3><ul class="seealso"><li><a href="https://www.apache.org/dist/httpd/CHANGES_2.4">httpd changelog</a></li><li><a href="https://bz.apache.org/bugzilla/buglist.cgi?bug_status=__open__&list_id=144532&product=Apache%20httpd-2&query_format=specific&order=changeddate%20DESC%2Cpriority%2Cbug_severity&component=mod_authz_dbd">Known issues</a></li><li><a href="https://bz.apache.org/bugzilla/enter_bug.cgi?product=Apache%20httpd-2&component=mod_authz_dbd">Report a bug</a></li></ul><h3>See also</h3> +<ul class="seealso"> +<li><code class="directive"><a href="../mod/mod_authz_core.html#require">Require</a></code></li> +<li> + <code class="directive"><a href="../mod/mod_authn_dbd.html#authdbduserpwquery">AuthDBDUserPWQuery</a></code> +</li> +<li><code class="directive"><a href="../mod/mod_dbd.html#dbdriver">DBDriver</a></code></li> +<li><code class="directive"><a href="../mod/mod_dbd.html#dbdparams">DBDParams</a></code></li> +<li><a href="#comments_section">Comments</a></li></ul></div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="requiredirectives" id="requiredirectives">The Require Directives</a></h2> + + <p>Apache's <code class="directive"><a href="../mod/mod_authz_core.html#require">Require</a></code> + directives are used during the authorization phase to ensure that + a user is allowed to access a resource. mod_authz_dbd extends the + authorization types with <code>dbd-group</code>, <code>dbd-login</code> and + <code>dbd-logout</code>.</p> + + <p>Since v2.4.8, <a href="../expr.html">expressions</a> are supported + within the DBD require directives.</p> + +<h3><a name="reqgroup" id="reqgroup">Require dbd-group</a></h3> + + <p>This directive specifies group membership that is required for the + user to gain access.</p> + + <pre class="prettyprint lang-config">Require dbd-group team +AuthzDBDQuery "SELECT group FROM authz WHERE user = %s"</pre> + + + + +<h3><a name="reqlogin" id="reqlogin">Require dbd-login</a></h3> + + <p>This directive specifies a query to be run indicating the user + has logged in.</p> + + <pre class="prettyprint lang-config">Require dbd-login +AuthzDBDQuery "UPDATE authn SET login = 'true' WHERE user = %s"</pre> + + + + +<h3><a name="reqlogout" id="reqlogout">Require dbd-logout</a></h3> + + <p>This directive specifies a query to be run indicating the user + has logged out.</p> + + <pre class="prettyprint lang-config">Require dbd-logout +AuthzDBDQuery "UPDATE authn SET login = 'false' WHERE user = %s"</pre> + + + + +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="login" id="login">Database Login</a></h2> + +<p> +In addition to the standard authorization function of checking group +membership, this module can also provide server-side user session +management via database-backed login/logout capabilities. +Specifically, it can update a user's session status in the database +whenever the user visits designated URLs (subject of course to users +supplying the necessary credentials).</p> +<p>This works by defining two special +<code class="directive"><a href="../mod/mod_authz_core.html#require">Require</a></code> types: +<code>Require dbd-login</code> and <code>Require dbd-logout</code>. +For usage details, see the configuration example below.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="client" id="client">Client Login integration</a></h2> + +<p>Some administrators may wish to implement client-side session +management that works in concert with the server-side login/logout +capabilities offered by this module, for example, by setting or unsetting +an HTTP cookie or other such token when a user logs in or out.</p> +<p>To support such integration, <code class="module"><a href="../mod/mod_authz_dbd.html">mod_authz_dbd</a></code> exports an +optional hook that will be run whenever a user's status is updated in +the database. Other session management modules can then use the hook +to implement functions that start and end client-side sessions.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="example" id="example">Configuration example</a></h2> + +<pre class="prettyprint lang-config"># mod_dbd configuration +DBDriver pgsql +DBDParams "dbname=apacheauth user=apache pass=xxxxxx" + +DBDMin 4 +DBDKeep 8 +DBDMax 20 +DBDExptime 300 + +<Directory "/usr/www/my.site/team-private/"> + # mod_authn_core and mod_auth_basic configuration + # for mod_authn_dbd + AuthType Basic + AuthName Team + AuthBasicProvider dbd + + # mod_authn_dbd SQL query to authenticate a logged-in user + AuthDBDUserPWQuery \ + "SELECT password FROM authn WHERE user = %s AND login = 'true'" + + # mod_authz_core configuration for mod_authz_dbd + Require dbd-group team + + # mod_authz_dbd configuration + AuthzDBDQuery "SELECT group FROM authz WHERE user = %s" + + # when a user fails to be authenticated or authorized, + # invite them to login; this page should provide a link + # to /team-private/login.html + ErrorDocument 401 "/login-info.html" + + <Files "login.html"> + # don't require user to already be logged in! + AuthDBDUserPWQuery "SELECT password FROM authn WHERE user = %s" + + # dbd-login action executes a statement to log user in + Require dbd-login + AuthzDBDQuery "UPDATE authn SET login = 'true' WHERE user = %s" + + # return user to referring page (if any) after + # successful login + AuthzDBDLoginToReferer On + </Files> + + <Files "logout.html"> + # dbd-logout action executes a statement to log user out + Require dbd-logout + AuthzDBDQuery "UPDATE authn SET login = 'false' WHERE user = %s" + </Files> +</Directory></pre> + +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="AuthzDBDLoginToReferer" id="AuthzDBDLoginToReferer">AuthzDBDLoginToReferer</a> <a name="authzdbdlogintoreferer" id="authzdbdlogintoreferer">Directive</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determines whether to redirect the Client to the Referring +page on successful login or logout if a <code>Referer</code> request +header is present</td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthzDBDLoginToReferer On|Off</code></td></tr> +<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AuthzDBDLoginToReferer Off</code></td></tr> +<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory</td></tr> +<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_authz_dbd</td></tr> +</table> + <p>In conjunction with <code>Require dbd-login</code> or + <code>Require dbd-logout</code>, this provides the option to + redirect the client back to the Referring page (the URL in + the <code>Referer</code> HTTP request header, if present). + When there is no <code>Referer</code> header, + <code>AuthzDBDLoginToReferer On</code> will be ignored.</p> + +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="AuthzDBDQuery" id="AuthzDBDQuery">AuthzDBDQuery</a> <a name="authzdbdquery" id="authzdbdquery">Directive</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Specify the SQL Query for the required operation</td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthzDBDQuery <var>query</var></code></td></tr> +<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory</td></tr> +<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_authz_dbd</td></tr> +</table> + <p>The <code class="directive">AuthzDBDQuery</code> specifies an SQL + query to run. The purpose of the query depends on the + <code class="directive"><a href="../mod/mod_authz_core.html#require">Require</a></code> directive in + effect.</p> + <ul> + <li>When used with a <code>Require dbd-group</code> directive, + it specifies a query to look up groups for the current user. This is + the standard functionality of other authorization modules such as + <code class="module"><a href="../mod/mod_authz_groupfile.html">mod_authz_groupfile</a></code> and <code class="module"><a href="../mod/mod_authz_dbm.html">mod_authz_dbm</a></code>. + The first column value of each row returned by the query statement + should be a string containing a group name. Zero, one, or more rows + may be returned. + <pre class="prettyprint lang-config">Require dbd-group +AuthzDBDQuery "SELECT group FROM groups WHERE user = %s"</pre> + + </li> + <li>When used with a <code>Require dbd-login</code> or + <code>Require dbd-logout</code> directive, it will never deny access, + but will instead execute a SQL statement designed to log the user + in or out. The user must already be authenticated with + <code class="module"><a href="../mod/mod_authn_dbd.html">mod_authn_dbd</a></code>. + <pre class="prettyprint lang-config">Require dbd-login +AuthzDBDQuery "UPDATE authn SET login = 'true' WHERE user = %s"</pre> + + </li> + </ul> + <p>In all cases, the user's ID will be passed as a single string + parameter when the SQL query is executed. It may be referenced within + the query statement using a <code>%s</code> format specifier.</p> + +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="AuthzDBDRedirectQuery" id="AuthzDBDRedirectQuery">AuthzDBDRedirectQuery</a> <a name="authzdbdredirectquery" id="authzdbdredirectquery">Directive</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Specify a query to look up a login page for the user</td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthzDBDRedirectQuery <var>query</var></code></td></tr> +<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory</td></tr> +<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_authz_dbd</td></tr> +</table> + <p>Specifies an optional SQL query to use after successful login + (or logout) to redirect the user to a URL, which may be + specific to the user. The user's ID will be passed as a single string + parameter when the SQL query is executed. It may be referenced within + the query statement using a <code>%s</code> format specifier.</p> + <pre class="prettyprint lang-config">AuthzDBDRedirectQuery "SELECT userpage FROM userpages WHERE user = %s"</pre> + + <p>The first column value of the first row returned by the query + statement should be a string containing a URL to which to redirect + the client. Subsequent rows will be ignored. If no rows are returned, + the client will not be redirected.</p> + <p>Note that <code class="directive">AuthzDBDLoginToReferer</code> takes + precedence if both are set.</p> + +</div> +</div> +<div class="bottomlang"> +<p><span>Available Languages: </span><a href="../en/mod/mod_authz_dbd.html" title="English"> en </a> | +<a href="../fr/mod/mod_authz_dbd.html" hreflang="fr" rel="alternate" title="Français"> fr </a></p> +</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">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&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> +<script type="text/javascript"><!--//--><![CDATA[//><!-- +var comments_shortname = 'httpd'; +var comments_identifier = 'http://httpd.apache.org/docs/2.4/mod/mod_authz_dbd.html'; +(function(w, d) { + if (w.location.hostname.toLowerCase() == "httpd.apache.org") { + d.write('<div id="comments_thread"><\/div>'); + var s = d.createElement('script'); + s.type = 'text/javascript'; + s.async = true; + s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; + (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); + } + else { + d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); + } +})(window, document); +//--><!]]></script></div><div id="footer"> +<p class="apache">Copyright 2019 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- +if (typeof(prettyPrint) !== 'undefined') { + prettyPrint(); +} +//--><!]]></script> +</body></html>
\ No newline at end of file diff --git a/docs/manual/mod/mod_authz_dbd.html.fr.utf8 b/docs/manual/mod/mod_authz_dbd.html.fr.utf8 new file mode 100644 index 0000000..9351b10 --- /dev/null +++ b/docs/manual/mod/mod_authz_dbd.html.fr.utf8 @@ -0,0 +1,334 @@ +<?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 content="text/html; charset=UTF-8" http-equiv="Content-Type" /> +<!-- + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + This file is generated from xml source: DO NOT EDIT + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + --> +<title>mod_authz_dbd - Serveur HTTP Apache Version 2.4</title> +<link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> +<link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> +<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" /> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> +</script> + +<link href="../images/favicon.ico" rel="shortcut icon" /></head> +<body> +<div id="page-header"> +<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.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> +<p class="apache">Serveur HTTP Apache Version 2.4</p> +<img alt="" src="../images/feather.png" /></div> +<div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div> +<div id="path"> +<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">Serveur HTTP</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.4</a> > <a href="./">Modules</a></div> +<div id="page-content"> +<div id="preamble"><h1>Module Apache mod_authz_dbd</h1> +<div class="toplang"> +<p><span>Langues Disponibles: </span><a href="../en/mod/mod_authz_dbd.html" hreflang="en" rel="alternate" title="English"> en </a> | +<a href="../fr/mod/mod_authz_dbd.html" title="Français"> fr </a></p> +</div> +<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Autorisation en groupe et reconnaissance d'identitĂ© avec base +SQL</td></tr> +<tr><th><a href="module-dict.html#Status">Statut:</a></th><td>Extension</td></tr> +<tr><th><a href="module-dict.html#ModuleIdentifier">Identificateur de Module:</a></th><td>authz_dbd_module</td></tr> +<tr><th><a href="module-dict.html#SourceFile">Fichier Source:</a></th><td>mod_authz_dbd.c</td></tr> +<tr><th><a href="module-dict.html#Compatibility">CompatibilitĂ©:</a></th><td>Disponible dans les versions 2.4 et supĂ©rieures +d'Apache</td></tr></table> +<h3>Sommaire</h3> + + <p>Ce module fournit des fonctionnalitĂ©s d'autorisation permettant + d'accorder ou de refuser aux utilisateurs authentifiĂ©s l'accĂšs Ă + certaines zones du site web en fonction de leur appartenance Ă tel + ou tel groupe. Les modules <code class="module"><a href="../mod/mod_authz_groupfile.html">mod_authz_groupfile</a></code> et + <code class="module"><a href="../mod/mod_authz_dbm.html">mod_authz_dbm</a></code> fournissent une fonctionnalitĂ© + similaire, mais ici le module interroge une base de donnĂ©es SQL pour + dĂ©terminer si un utilisateur appartient ou non Ă tel ou tel groupe.</p> + <p>Ce module propose Ă©galement des fonctionnalitĂ©s de connexion + utilisateur s'appuyant sur une base de donnĂ©es, ce qui peut se rĂ©vĂ©ler + particuliĂšrement utile lorsque le module est utilisĂ© conjointement avec + <code class="module"><a href="../mod/mod_authn_dbd.html">mod_authn_dbd</a></code>.</p> + <p>Ce module s'appuie sur <code class="module"><a href="../mod/mod_dbd.html">mod_dbd</a></code> pour spĂ©cifier le + pilote de la base de donnĂ©es sous-jacente et les paramĂštres de + connexion, et gĂ©rer les connexions Ă la base de donnĂ©es.</p> +</div> +<div id="quickview"><a href="https://www.apache.org/foundation/contributing.html" class="badge"><img src="https://www.apache.org/images/SupportApache-small.png" alt="Support Apache!" /></a><h3>Sujets</h3> +<ul id="topics"> +<li><img alt="" src="../images/down.gif" /> <a href="#requiredirectives">Les directives Require</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#login">Reconnaissance d'identitĂ© s'appuyant sur une base de donnĂ©es</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#client">Reconnaissance d'identitĂ© cĂŽtĂ© client</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#example">Exemple de configuration</a></li> +</ul><h3 class="directives">Directives</h3> +<ul id="toc"> +<li><img alt="" src="../images/down.gif" /> <a href="#authzdbdlogintoreferer">AuthzDBDLoginToReferer</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#authzdbdquery">AuthzDBDQuery</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#authzdbdredirectquery">AuthzDBDRedirectQuery</a></li> +</ul> +<h3>Traitement des bugs</h3><ul class="seealso"><li><a href="https://www.apache.org/dist/httpd/CHANGES_2.4">Journal des modifications de httpd</a></li><li><a href="https://bz.apache.org/bugzilla/buglist.cgi?bug_status=__open__&list_id=144532&product=Apache%20httpd-2&query_format=specific&order=changeddate%20DESC%2Cpriority%2Cbug_severity&component=mod_authz_dbd">ProblĂšmes connus</a></li><li><a href="https://bz.apache.org/bugzilla/enter_bug.cgi?product=Apache%20httpd-2&component=mod_authz_dbd">Signaler un bug</a></li></ul><h3>Voir aussi</h3> +<ul class="seealso"> +<li><code class="directive"><a href="../mod/mod_authz_core.html#require">Require</a></code></li> +<li> + <code class="directive"><a href="../mod/mod_authn_dbd.html#authdbduserpwquery">AuthDBDUserPWQuery</a></code> +</li> +<li><code class="directive"><a href="../mod/mod_dbd.html#dbdriver">DBDriver</a></code></li> +<li><code class="directive"><a href="../mod/mod_dbd.html#dbdparams">DBDParams</a></code></li> +<li><a href="#comments_section">Commentaires</a></li></ul></div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="requiredirectives" id="requiredirectives">Les directives Require</a></h2> + + <p>Les directives <code class="directive"><a href="../mod/mod_authz_core.html#require">Require</a></code> d'Apache permettent, + au cours de la phase d'autorisation, de s'assurer qu'un utilisateur + est bien autorisĂ© Ă accĂ©der Ă une ressource. mod_authz_dbd ajoute + les types d'autorisation <code>dbd-group</code>, + <code>dbd-login</code> et <code>dbd-logout</code>.</p> + + <p>A partir de la version 2.4.8, les directives require DBD + supportent les <a href="../expr.html">expressions</a>.</p> + +<h3><a name="reqgroup" id="reqgroup">Require dbd-group</a></h3> + + <p>Cette directive permet de spĂ©cifier Ă quel groupe un utilisateur + doit appartenir pour obtenir l'autorisation d'accĂšs.</p> + + <pre class="prettyprint lang-config">Require dbd-group team +AuthzDBDQuery "SELECT group FROM authz WHERE user = %s"</pre> + + + + +<h3><a name="reqlogin" id="reqlogin">Require dbd-login</a></h3> + + <p>Cette directive permet de spĂ©cifier une requĂȘte Ă exĂ©cuter pour + indiquer que l'utilisateur s'est authentifiĂ©.</p> + + <pre class="prettyprint lang-config">Require dbd-login +AuthzDBDQuery "UPDATE authn SET login = 'true' WHERE user = %s"</pre> + + + + +<h3><a name="reqlogout" id="reqlogout">Require dbd-logout</a></h3> + + <p>Cette directive permet de spĂ©cifier une requĂȘte Ă exĂ©cuter pour + indiquer que l'utilisateur s'est dĂ©connectĂ©.</p> + + <pre class="prettyprint lang-config">Require dbd-logout +AuthzDBDQuery "UPDATE authn SET login = 'false' WHERE user = %s"</pre> + + + + +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="login" id="login">Reconnaissance d'identitĂ© s'appuyant sur une base de donnĂ©es</a></h2> + +<p> +Outre sa fonction d'autorisation standard consistant Ă vĂ©rifier +l'appartenance Ă des groupes, ce module permet aussi de gĂ©rer des +sessions utilisateur cĂŽtĂ© serveur grĂące Ă sa fonctionnalitĂ© de connexion utilisateur +en s'appuyant sur une base de donnĂ©es. En particulier, il peut mettre Ă +jour le statut de session de l'utilisateur dans la base de donnĂ©es +chaque fois que celui-ci visite certaines URLs (sous rĂ©serve bien +entendu que l'utilisateur fournissent les informations de connexion +nĂ©cessaires).</p> +<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 +dbd-login</code> et <code>Require dbd-logout</code>. Pour les dĂ©tails de +leur utilisation, voir l'exemple de configuration ci-dessous.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="client" id="client">Reconnaissance d'identitĂ© cĂŽtĂ© client</a></h2> + +<p>Certains administrateurs peuvent vouloir implĂ©menter une gestion de +session cĂŽtĂ© client fonctionnant de concert avec les fonctionnalitĂ©s de +connexion/dĂ©connexion des utilisateurs cĂŽtĂ© serveur offertes par ce module, en +dĂ©finissant ou en annulant par exemple un cookie HTTP ou un jeton +similaire lorsqu'un utilisateur se connecte ou se dĂ©connecte.</p> + +<p>Pour supporter une telle intĂ©gration, <code class="module"><a href="../mod/mod_authz_dbd.html">mod_authz_dbd</a></code> exporte +un programme Ă dĂ©clenchement optionnel (hook) qui sera lancĂ© chaque fois +que le statut d'un utilisateur sera mis Ă jour dans la base de donnĂ©es. +D'autres modules de gestion de session pourront alors utiliser ce +programme pour implĂ©menter des fonctions permettant d'ouvrir et de +fermer des sessions cĂŽtĂ© client.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="example" id="example">Exemple de configuration</a></h2> + +<pre class="prettyprint lang-config"># configuration de mod_dbd +DBDriver pgsql +DBDParams "dbname=apacheauth user=apache pass=xxxxxx" + +DBDMin 4 +DBDKeep 8 +DBDMax 20 +DBDExptime 300 + +<Directory "/usr/www/mon.site/team-private/"> + # configuration de mod_authn_core et mod_auth_basic + # pour mod_authn_dbd + AuthType Basic + AuthName Team + AuthBasicProvider dbd + + # requĂȘte SQL de mod_authn_dbd pour authentifier un utilisateur qui se + # connecte + AuthDBDUserPWQuery \ + "SELECT password FROM authn WHERE user = %s AND login = 'true'" + + # configuration de mod_authz_core pour mod_authz_dbd + Require dbd-group team + + # configuration de mod_authz_dbd + AuthzDBDQuery "SELECT group FROM authz WHERE user = %s" + + # lorsqu'un utilisateur Ă©choue dans sa tentative d'authentification ou + # d'autorisation, on l'invite Ă se connecter ; cette page doit + # contenir un lien vers /team-private/login.html + ErrorDocument 401 "/login-info.html" + + <Files "login.html"> + # il n'est pas nĂ©cessaire que l'utilisateur soit dĂ©jĂ connectĂ© ! + AuthDBDUserPWQuery "SELECT password FROM authn WHERE user = %s" + + # le processus de connexion dbd exĂ©cute une requĂȘte pour enregistrer + # la connexion de l'utilisateur + Require dbd-login + AuthzDBDQuery "UPDATE authn SET login = 'true' WHERE user = %s" + + # redirige l'utilisateur vers la page d'origine (si elle existe) + # aprĂšs une connexion rĂ©ussie + AuthzDBDLoginToReferer On + </Files> + + <Files "logout.html"> + # le processus de dĂ©connexion dbd exĂ©cute une requĂȘte pour + # enregistrer la dĂ©connexion de l'utilisateur + Require dbd-logout + AuthzDBDQuery "UPDATE authn SET login = 'false' WHERE user = %s" + </Files> +</Directory></pre> + +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="authzdbdlogintoreferer" id="authzdbdlogintoreferer">Directive</a> <a name="AuthzDBDLoginToReferer" id="AuthzDBDLoginToReferer">AuthzDBDLoginToReferer</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>DĂ©finit si le client doit ĂȘtre redirigĂ© vers la page +d'origine en cas de connexion ou de dĂ©connexion rĂ©ussie si un en-tĂȘte +de requĂȘte <code>Referer</code> est prĂ©sent</td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntaxe:</a></th><td><code>AuthzDBDLoginToReferer On|Off</code></td></tr> +<tr><th><a href="directive-dict.html#Default">DĂ©faut:</a></th><td><code>AuthzDBDLoginToReferer Off</code></td></tr> +<tr><th><a href="directive-dict.html#Context">Contexte:</a></th><td>rĂ©pertoire</td></tr> +<tr><th><a href="directive-dict.html#Status">Statut:</a></th><td>Extension</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_authz_dbd</td></tr> +</table> + <p>UtilisĂ©e en conjonction avec <code>Require dbd-login</code> ou + <code>Require dbd-logout</code>, cette directive permet de rediriger + le client vers la page d'origine (l'URL contenue dans l'en-tĂȘte + de requĂȘte HTTP <code>Referer</code>, s'il est prĂ©sent). En + l'absence d'en-tĂȘte <code>Referer</code>, la dĂ©finition + <code>AuthzDBDLoginToReferer On</code> sera ignorĂ©e.</p> + +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="authzdbdquery" id="authzdbdquery">Directive</a> <a name="AuthzDBDQuery" id="AuthzDBDQuery">AuthzDBDQuery</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>DĂ©finit la requĂȘte SQL pour l'opĂ©ration requise</td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntaxe:</a></th><td><code>AuthzDBDQuery <var>requĂȘte</var></code></td></tr> +<tr><th><a href="directive-dict.html#Context">Contexte:</a></th><td>rĂ©pertoire</td></tr> +<tr><th><a href="directive-dict.html#Status">Statut:</a></th><td>Extension</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_authz_dbd</td></tr> +</table> + <p>La directive <code class="directive">AuthzDBDQuery</code> permet de + spĂ©cifier une requĂȘte SQL Ă exĂ©cuter. Le but de cette requĂȘte dĂ©pend + de la directive <code class="directive"><a href="../mod/mod_authz_core.html#require">Require</a></code> en cours de + traitement.</p> + <ul> + <li>Avec la directive <code>Require dbd-group</code>, elle spĂ©cifie + une requĂȘte permettant de rechercher les groupes d'appartenance de + l'utilisateur courant. Ceci correspond Ă la fonctionnalitĂ© standard + d'autres modules d'autorisation comme + <code class="module"><a href="../mod/mod_authz_groupfile.html">mod_authz_groupfile</a></code> et + <code class="module"><a href="../mod/mod_authz_dbm.html">mod_authz_dbm</a></code>. + La premiĂšre colonne de chaque enregistrement renvoyĂ© par la requĂȘte + doit contenir une chaĂźne de caractĂšres correspondant Ă un nom de + groupe. La requĂȘte peut renvoyer zĂ©ro, un ou plusieurs + enregistrements. + <pre class="prettyprint lang-config">Require dbd-group +AuthzDBDQuery "SELECT group FROM groups WHERE user = %s"</pre> + + </li> + <li>Avec la directive <code>Require dbd-login</code> ou + <code>Require dbd-logout</code>, elle ne refusera jamais l'accĂšs, + mais au contraire exĂ©cutera une requĂȘte SQL permettant d'enregistrer + la connexion ou la dĂ©connexion de l'utilisateur. Ce dernier doit + ĂȘtre dĂ©jĂ authentifiĂ© avec <code class="module"><a href="../mod/mod_authn_dbd.html">mod_authn_dbd</a></code>. + <pre class="prettyprint lang-config">Require dbd-login +AuthzDBDQuery "UPDATE authn SET login = 'true' WHERE user = %s"</pre> + + </li> + </ul> + <p>Dans tous les cas, l'identifiant utilisateur sera transmis comme + paramĂštre sous la forme d'une simple chaĂźne lorsque la requĂȘte SQL + sera exĂ©cutĂ©e. Il y sera fait rĂ©fĂ©rence dans la requĂȘte en utilisant + le spĂ©cificateur de format <code>%s</code>.</p> + +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="authzdbdredirectquery" id="authzdbdredirectquery">Directive</a> <a name="AuthzDBDRedirectQuery" id="AuthzDBDRedirectQuery">AuthzDBDRedirectQuery</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>DĂ©finit une requĂȘte pour rechercher une page vers laquelle +rediriger l'utilisateur aprĂšs une connexion rĂ©ussie</td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntaxe:</a></th><td><code>AuthzDBDRedirectQuery <var>requĂȘte</var></code></td></tr> +<tr><th><a href="directive-dict.html#Context">Contexte:</a></th><td>rĂ©pertoire</td></tr> +<tr><th><a href="directive-dict.html#Status">Statut:</a></th><td>Extension</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_authz_dbd</td></tr> +</table> + <p>SpĂ©cifie une requĂȘte SQL optionnelle Ă utiliser aprĂšs une + connexion (ou une dĂ©connexion) rĂ©ussie pour rediriger l'utilisateur + vers une URL, qui peut ĂȘtre spĂ©cifique Ă l'utilisateur. + L'identifiant utilisateur sera transmis comme paramĂštre sous la + forme d'une simple chaĂźne lorsque la requĂȘte SQL sera exĂ©cutĂ©e. Il y + sera fait rĂ©fĂ©rence dans la requĂȘte en utilisant le spĂ©cificateur de + format <code>%s</code>.</p> + <pre class="prettyprint lang-config">AuthzDBDRedirectQuery "SELECT userpage FROM userpages WHERE user = %s"</pre> + + <p>La premiĂšre colonne du premier enregistrement renvoyĂ© par la + requĂȘte doit contenir une chaĂźne de caractĂšres correspondant Ă une + URL vers laquelle rediriger le client. Les enregistrements suivants + sont ignorĂ©s. Si aucun enregistrement n'est renvoyĂ©, le client ne + sera pas redirigĂ©.</p> + <p>Notez que <code class="directive">AuthzDBDLoginToReferer</code> l'emporte + sur cette directive si les deux sont dĂ©finies.</p> + +</div> +</div> +<div class="bottomlang"> +<p><span>Langues Disponibles: </span><a href="../en/mod/mod_authz_dbd.html" hreflang="en" rel="alternate" title="English"> en </a> | +<a href="../fr/mod/mod_authz_dbd.html" title="Français"> fr </a></p> +</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&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> +<script type="text/javascript"><!--//--><![CDATA[//><!-- +var comments_shortname = 'httpd'; +var comments_identifier = 'http://httpd.apache.org/docs/2.4/mod/mod_authz_dbd.html'; +(function(w, d) { + if (w.location.hostname.toLowerCase() == "httpd.apache.org") { + d.write('<div id="comments_thread"><\/div>'); + var s = d.createElement('script'); + s.type = 'text/javascript'; + s.async = true; + s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; + (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); + } + else { + d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); + } +})(window, document); +//--><!]]></script></div><div id="footer"> +<p class="apache">Copyright 2019 The Apache Software Foundation.<br />AutorisĂ© sous <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.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[//><!-- +if (typeof(prettyPrint) !== 'undefined') { + prettyPrint(); +} +//--><!]]></script> +</body></html>
\ No newline at end of file |