home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / apache_2.2.8-win32-x86-no_ssl.msi / Data1.cab / _80007B22C7351696A1BB790EA2176D41 < prev    next >
Extensible Markup Language  |  2007-11-14  |  10KB  |  179 lines

  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
  4.         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  5.               This file is generated from xml source: DO NOT EDIT
  6.         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  7.       -->
  8. <title>mod_authn_dbd - Apache HTTP Server</title>
  9. <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
  10. <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
  11. <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
  12. <link href="../images/favicon.ico" rel="shortcut icon" /></head>
  13. <body>
  14. <div id="page-header">
  15. <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
  16. <p class="apache">Apache HTTP Server Version 2.2</p>
  17. <img alt="" src="../images/feather.gif" /></div>
  18. <div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div>
  19. <div id="path">
  20. <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.2</a> > <a href="./">Modules</a></div>
  21. <div id="page-content">
  22. <div id="preamble"><h1>Apache Module mod_authn_dbd</h1>
  23. <div class="toplang">
  24. <p><span>Available Languages: </span><a href="../en/mod/mod_authn_dbd.html" title="English"> en </a></p>
  25. </div>
  26. <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>User authentication using an SQL database</td></tr>
  27. <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  28. <tr><th><a href="module-dict.html#ModuleIdentifier">ModuleáIdentifier:</a></th><td>authn_dbd_module</td></tr>
  29. <tr><th><a href="module-dict.html#SourceFile">SourceáFile:</a></th><td>mod_authn_dbd.c</td></tr>
  30. <tr><th><a href="module-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.1 and later</td></tr></table>
  31. <h3>Summary</h3>
  32.  
  33.     <p>This module provides authentication front-ends such as
  34.     <code class="module"><a href="../mod/mod_auth_digest.html">mod_auth_digest</a></code> and <code class="module"><a href="../mod/mod_auth_basic.html">mod_auth_basic</a></code>
  35.     to authenticate users by looking up users in SQL tables.
  36.     Similar functionality is provided by, for example,
  37.     <code class="module"><a href="../mod/mod_authn_file.html">mod_authn_file</a></code>.</p>
  38.     <p>This module relies on <code class="module"><a href="../mod/mod_dbd.html">mod_dbd</a></code> to specify
  39.     the backend database driver and connection parameters, and
  40.     manage the database connections.</p>
  41.  
  42.     <p>When using <code class="module"><a href="../mod/mod_auth_basic.html">mod_auth_basic</a></code> or
  43.     <code class="module"><a href="../mod/mod_auth_digest.html">mod_auth_digest</a></code>, this module is invoked via the
  44.     <code class="directive"><a href="../mod/mod_auth_basic.html#authbasicprovider">AuthBasicProvider</a></code> or
  45.     <code class="directive"><a href="../mod/mod_auth_digest.html#authdigestprovider">AuthDigestProvider</a></code>
  46.     with the <code>dbd</code> value.</p>
  47. </div>
  48. <div id="quickview"><h3 class="directives">Directives</h3>
  49. <ul id="toc">
  50. <li><img alt="" src="../images/down.gif" /> <a href="#authdbduserpwquery">AuthDBDUserPWQuery</a></li>
  51. <li><img alt="" src="../images/down.gif" /> <a href="#authdbduserrealmquery">AuthDBDUserRealmQuery</a></li>
  52. </ul>
  53. <h3>Topics</h3>
  54. <ul id="topics">
  55. <li><img alt="" src="../images/down.gif" /> <a href="#example">Configuration Example</a></li>
  56. <li><img alt="" src="../images/down.gif" /> <a href="#exposed">Exposing Login Information</a></li>
  57. </ul><h3>See also</h3>
  58. <ul class="seealso">
  59. <li><code class="directive"><a href="../mod/core.html#authname">AuthName</a></code></li>
  60. <li><code class="directive"><a href="../mod/core.html#authtype">AuthType</a></code></li>
  61. <li>
  62.   <code class="directive"><a href="../mod/mod_auth_basic.html#authbasicprovider">AuthBasicProvider</a></code>
  63. </li>
  64. <li>
  65.   <code class="directive"><a href="../mod/mod_auth_digest.html#authdigestprovider">AuthDigestProvider</a></code>
  66. </li>
  67. <li><code class="directive"><a href="../mod/mod_dbd.html#dbdriver">DBDriver</a></code></li>
  68. <li><code class="directive"><a href="../mod/mod_dbd.html#dbdparams">DBDParams</a></code></li>
  69. </ul></div>
  70. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  71. <div class="section">
  72. <h2><a name="example" id="example">Configuration Example</a></h2>
  73.  
  74. <p>This simple example shows use of this module in the context of
  75. the Authentication and DBD frameworks.</p>
  76. <div class="example"><pre>
  77. #Database Management
  78.  
  79. #Use the PostgreSQL driver
  80. <code>DBDriver pgsql</code>
  81.  
  82. #Connection string: database name and login credentials
  83. <code>DBDParams "dbname=htpasswd user=apache password=xxxxxx"</code>
  84.  
  85. #Parameters for Connection Pool Management
  86. <code>DBDMin  1
  87. DBDKeep 2
  88. DBDMax  10
  89. DBDExptime 60</code>
  90.  
  91. #Authentication Section
  92. <code><Directory /usr/www/myhost/private></code>
  93.  
  94.     #mod_auth configuration for authn_dbd
  95.     <code>AuthType Basic
  96.     AuthName "My Server"
  97.     AuthBasicProvider dbd</code>
  98.  
  99.     #authz configuration
  100.     <code>Require valid-user</code>
  101.  
  102.     #SQL query to verify a user
  103.     #(note: DBD drivers recognise both stdio-like %s and native syntax)
  104.     <code>AuthDBDUserPWQuery "select password from authn where username = %s"
  105. </Directory></code>
  106. </pre></div>
  107. </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  108. <div class="section">
  109. <h2><a name="exposed" id="exposed">Exposing Login Information</a></h2>
  110.  
  111. <p>
  112. Whenever a query is made to the database server, all columns returned by
  113. the query are placed in the environment, using environment variables with
  114. the prefix "AUTHENTICATE_".
  115. </p>
  116. <p>If a database query for example returned the username, full name
  117. and telephone number of a user, a CGI program will have access to
  118. this information without the need to make a second independent database
  119. query to gather this additional information.</p>
  120. <p>This has the potential to dramatically simplify the coding and
  121. configuration required in some web applications.
  122. </p>
  123. </div>
  124. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  125. <div class="directive-section"><h2><a name="AuthDBDUserPWQuery" id="AuthDBDUserPWQuery">AuthDBDUserPWQuery</a> <a name="authdbduserpwquery" id="authdbduserpwquery">Directive</a></h2>
  126. <table class="directive">
  127. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>SQL query to look up a password for a user</td></tr>
  128. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthDBDUserPWQuery <var>query</var></code></td></tr>
  129. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory</td></tr>
  130. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  131. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_authn_dbd</td></tr>
  132. </table>
  133.     <p>The <code class="directive">AuthDBDUserPWQuery</code> specifies an
  134.     SQL query to look up a password for a specified user.
  135.     The query must take a single string (typically SQL varchar)
  136.     argument (username), and return a single value (encrypted password).
  137.     </p>
  138.     <div class="example"><p><code>
  139.     AuthDBDUserPWQuery "SELECT password FROM authn WHERE username = %s"
  140.     </code></p></div>
  141.     <p>If httpd was built against apr v1.3.0 or higher, any additional
  142.     columns specified in the select statement will be inserted into
  143.     the environment with the name <code>AUTHENTICATE_<COLUMN></code>.
  144.     </p>
  145.  
  146. </div>
  147. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  148. <div class="directive-section"><h2><a name="AuthDBDUserRealmQuery" id="AuthDBDUserRealmQuery">AuthDBDUserRealmQuery</a> <a name="authdbduserrealmquery" id="authdbduserrealmquery">Directive</a></h2>
  149. <table class="directive">
  150. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>SQL query to look up a password hash for a user and realm.
  151. </td></tr>
  152. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthDBDUserRealmQuery <var>query</var></code></td></tr>
  153. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory</td></tr>
  154. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  155. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_authn_dbd</td></tr>
  156. </table>
  157.     <p>The <code class="directive">AuthDBDUserRealmQuery</code> specifies an
  158.     SQL query to look up a password for a specified user and realm.
  159.     The query must take two string (typically SQL varchar) arguments
  160.     (username and realm), and return a single value (encrypted password).
  161.     </p>
  162.     <div class="example"><p><code>
  163.     AuthDBDUserRealmQuery "SELECT password FROM authn
  164.                               WHERE username = %s AND realm = %s"
  165.     </code></p></div>
  166.     <p>If httpd was built against apr v1.3.0 or higher, any additional
  167.     columns specified in the select statement will be inserted into
  168.     the environment with the name <code>AUTHENTICATE_<COLUMN></code>.
  169.     </p>
  170.  
  171.  
  172. </div>
  173. </div>
  174. <div class="bottomlang">
  175. <p><span>Available Languages: </span><a href="../en/mod/mod_authn_dbd.html" title="English"> en </a></p>
  176. </div><div id="footer">
  177. <p class="apache">Copyright 2007 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>
  178. <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>
  179. </body></html>