lemonldap-ng/doc/pages/documentation/1.4/authdbi.html

265 lines
9.3 KiB
HTML
Raw Normal View History

<!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="en"
lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<!-- metadata -->
<meta name="generator" content="Offline" />
<meta name="version" content="Offline 0.1" />
<!-- style sheet links -->
<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><a name="databases" id="databases">Databases</a></h1>
<div class="level1">
<table class="inline">
<tr class="row0 roweven">
<th class="col0">Authentication </th><th class="col1"> Users </th><th class="col2"> Password </th>
</tr>
<tr class="row1 rowodd">
<td class="col0 centeralign"></td><td class="col1 centeralign"></td><td class="col2 centeralign"></td>
</tr>
</table>
</div>
<!-- SECTION "Databases" [1-89] -->
<h2><a name="presentation" id="presentation">Presentation</a></h2>
<div class="level2">
</div>
<!-- SECTION "Presentation" [90-115] -->
<h3><a name="drivers" id="drivers">Drivers</a></h3>
<div class="level3">
<p>
<acronym title="LemonLDAP::NG">LL::NG</acronym> can use a lot of databases as authentication, users and password backend:
</p>
<ul>
<li class="level1"><div class="li"> MySQL</div>
</li>
<li class="level1"><div class="li"> PostGreSQL</div>
</li>
<li class="level1"><div class="li"> Oracle</div>
</li>
<li class="level1"><div class="li"></div>
</li>
</ul>
<p>
Indeed, any <a href="http://search.cpan.org/search?query=DBD%3A%3A&amp;mode=module" class="urlextern" title="http://search.cpan.org/search?query=DBD%3A%3A&amp;mode=module" rel="nofollow">Perl DBD driver</a> can be used.
</p>
</div>
<!-- SECTION "Drivers" [116-364] -->
<h3><a name="schema" id="schema">Schema</a></h3>
<div class="level3">
<p>
<acronym title="LemonLDAP::NG">LL::NG</acronym> can use two tables:
</p>
<ul>
<li class="level1"><div class="li"> Authentication table: where login and password are stored</div>
</li>
<li class="level1"><div class="li"> User table: where user data are stored (mail, name, etc.)</div>
</li>
</ul>
<p>
<p><div class="notetip">Authentication table and user table can be the same.
</div></p>
</p>
<p>
The password can be in plain text, or encoded with a standard <acronym title="Structured Query Language">SQL</acronym> method:
</p>
<ul>
<li class="level1"><div class="li"> SHA</div>
</li>
<li class="level1"><div class="li"> SHA1</div>
</li>
<li class="level1"><div class="li"> MD5</div>
</li>
</ul>
</div>
<h4><a name="example_1two_tables" id="example_1two_tables">Example 1: two tables</a></h4>
<div class="level4">
</div>
<h5><a name="authentication_table" id="authentication_table">Authentication table</a></h5>
<div class="level5">
<table class="inline">
<tr class="row0 roweven">
<th class="col0"> id </th><th class="col1"> login </th><th class="col2"> password </th>
</tr>
<tr class="row1 rowodd">
<td class="col0"> 0 </td><td class="col1"> coudot </td><td class="col2"> 1f777a6581e478499f4284e54fe2d4a4e513dfff </td>
</tr>
<tr class="row2 roweven">
<td class="col0"> 1 </td><td class="col1"> xguimard </td><td class="col2"> a15a18c8bb17e6f67886a9af1898c018b9f5a072 </td>
</tr>
<tr class="row3 rowodd">
<td class="col0"> 2 </td><td class="col1"> tchemineau </td><td class="col2"> 1f777a6581e478499f4284e54fe2d4a4e513dfff </td>
</tr>
</table>
</div>
<h5><a name="user_table" id="user_table">User table</a></h5>
<div class="level5">
<table class="inline">
<tr class="row0 roweven">
<th class="col0"> id </th><th class="col1"> user </th><th class="col2"> name </th><th class="col3"> mail </th>
</tr>
<tr class="row1 rowodd">
<td class="col0"> 0 </td><td class="col1"> coudot </td><td class="col2"> Clément OUDOT </td><td class="col3"> coudot@example.com </td>
</tr>
<tr class="row2 roweven">
<td class="col0"> 1 </td><td class="col1"> tchemineau </td><td class="col2"> Thomas CHEMINEAU </td><td class="col3"> tchemineau@example.com </td>
</tr>
<tr class="row3 rowodd">
<td class="col0"> 2 </td><td class="col1"> xguimard </td><td class="col2"> Xavier GUIMARD </td><td class="col3"> xguimard@example.com </td>
</tr>
</table>
</div>
<h4><a name="example_2single_table" id="example_2single_table">Example 2: single table</a></h4>
<div class="level4">
<table class="inline">
<tr class="row0 roweven">
<th class="col0"> id </th><th class="col1"> user </th><th class="col2"> password </th><th class="col3"> name </th><th class="col4"> mail </th>
</tr>
<tr class="row1 rowodd">
<td class="col0"> 0 </td><td class="col1"> coudot </td><td class="col2"> 1f777a6581e478499f4284e54fe2d4a4e513dfff </td><td class="col3"> Clément OUDOT </td><td class="col4"> coudot@example.com </td>
</tr>
<tr class="row2 roweven">
<td class="col0"> 1 </td><td class="col1"> tchemineau </td><td class="col2"> 1f777a6581e478499f4284e54fe2d4a4e513dfff </td><td class="col3"> Thomas CHEMINEAU </td><td class="col4"> tchemineau@example.com </td>
</tr>
<tr class="row3 rowodd">
<td class="col0"> 2 </td><td class="col1"> xguimard </td><td class="col2"> a15a18c8bb17e6f67886a9af1898c018b9f5a072 </td><td class="col3"> Xavier GUIMARD </td><td class="col4"> xguimard@example.com </td>
</tr>
</table>
</div>
<!-- SECTION "Schema" [365-1566] -->
<h3><a name="sql" id="sql">SQL</a></h3>
<div class="level3">
<p>
<acronym title="LemonLDAP::NG">LL::NG</acronym> will operate some <acronym title="Structured Query Language">SQL</acronym> queries:
</p>
<ul>
<li class="level1"><div class="li"> Authentication: select row in authentication table matching user and password</div>
</li>
<li class="level1"><div class="li"> Search user: select row in user table matching user</div>
</li>
<li class="level1"><div class="li"> Change password: update password column in authentication table matching user</div>
</li>
</ul>
</div>
<!-- SECTION "SQL" [1567-1840] -->
<h2><a name="configuration" id="configuration">Configuration</a></h2>
<div class="level2">
<p>
In Manager, go in <code>General Parameters</code> &gt; <code>Authentication modules</code> and choose Database (<acronym title="Database Interface">DBI</acronym>) for authentication, users and/or password modules.
</p>
</div>
<!-- SECTION "Configuration" [1841-2015] -->
<h3><a name="authentication_level" id="authentication_level">Authentication level</a></h3>
<div class="level3">
<p>
The authentication level given to users authenticated with this module.
</p>
<p>
<p><div class="noteimportant">
As <acronym title="Database Interface">DBI</acronym> is a login/password based module, the authentication level can be:
</p>
<ul>
<li class="level1"><div class="li"> increased (+1) if portal is protected by <acronym title="Secure Sockets Layer">SSL</acronym> (HTTPS)</div>
</li>
2013-11-02 22:09:55 +01:00
<li class="level1"><div class="li"> decreased (-1) if the portal autocompletion is allowed (see <a href="../../documentation/1.4/portalcustom.html" class="wikilink1" title="documentation:1.4:portalcustom">portal customization</a>)</div>
</li>
</ul>
<p>
</div></p>
</p>
</div>
<!-- SECTION "Authentication level" [2016-2380] -->
<h3><a name="connection" id="connection">Connection</a></h3>
<div class="level3">
<p>
<p><div class="notetip">Connection settings can be configured differently for authentication process and user process. This allows to use different databases for these process. By default, if user process connection settings are empty, authentication process connection settings will be used.
</div></p>
</p>
<ul>
<li class="level1"><div class="li"> <strong>Chain</strong>: <acronym title="Database Interface">DBI</acronym> chain, including database driver name and database name (for example: dbi:mysql:database=lemonldapng;host=localhost).</div>
</li>
<li class="level1"><div class="li"> <strong>User</strong>: Connection user</div>
</li>
<li class="level1"><div class="li"> <strong>Password</strong>: Connection password</div>
</li>
</ul>
</div>
<!-- SECTION "Connection" [2381-2895] -->
<h3><a name="schema1" id="schema1">Schema</a></h3>
<div class="level3">
<ul>
<li class="level1"><div class="li"> <strong>Authentication table</strong>: authentication table name</div>
</li>
<li class="level1"><div class="li"> <strong>User table</strong>: user table name</div>
</li>
<li class="level1"><div class="li"> <strong>Login field name</strong>: name of authentication table column hosting login</div>
</li>
<li class="level1"><div class="li"> <strong>Password field name</strong>: name of authentication table column hosting password</div>
</li>
<li class="level1"><div class="li"> <strong>Mail field name</strong>: name of authentication table column hosting mail (for password reset)</div>
</li>
<li class="level1"><div class="li"> <strong>Login field name in user table</strong>: name of user table column hosting login</div>
</li>
</ul>
</div>
<!-- SECTION "Schema" [2896-3339] -->
<h3><a name="password" id="password">Password</a></h3>
<div class="level3">
<ul>
<li class="level1"><div class="li"> <strong>Hash schema</strong>: <acronym title="Structured Query Language">SQL</acronym> method for hashing password. Can be left blank for plain text passwords.</div>
</li>
</ul>
</div>
<!-- SECTION "Password" [3340-] --></div><!-- closes <div class="dokuwiki export">-->