lemonldap-ng/doc/pages/documentation/current/totp2f.html
Xavier Guimard ce59789747 Update doc
2019-06-28 16:53:45 +02:00

162 lines
8.3 KiB
HTML

<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8" />
<title>documentation:2.0:totp2f</title>
<meta name="generator" content="DokuWiki"/>
<meta name="robots" content="index,follow"/>
<meta name="keywords" content="documentation,2.0,totp2f"/>
<link rel="search" type="application/opensearchdescription+xml" href="lib/exe/opensearch.html" title="LemonLDAP::NG"/>
<link rel="start" href="totp2f.html"/>
<link rel="contents" href="totp2f.html" title="Sitemap"/>
<link rel="stylesheet" type="text/css" href="lib/exe/css.php.t.bootstrap3.css"/>
<!-- //if:usedebianlibs
<link rel="stylesheet" type="text/css" href="/javascript/bootstrap/css/bootstrap.min.css" />
//elsif:useexternallibs
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"></script>
//elsif:cssminified
<link rel="stylesheet" type="text/css" href="/static/bwr/bootstrap/dist/css/bootstrap.min.css" />
//else -->
<link rel="stylesheet" type="text/css" href="/static/bwr/bootstrap/dist/css/bootstrap.css" />
<!-- //endif -->
<script type="text/javascript">/*<![CDATA[*/var NS='documentation:2.0';var JSINFO = {"id":"documentation:2.0:totp2f","namespace":"documentation:2.0"};
/*!]]>*/</script>
<script type="text/javascript" charset="utf-8" src="lib/exe/js.php.t.bootstrap3.js"></script>
<!-- //if:usedebianlibs
<script type="text/javascript" src="/javascript/jquery/jquery.min.js"></script>
//elsif:useexternallibs
<script type="text/javascript" src="http://code.jquery.com/jquery-2.2.0.min.js"></script>
//elsif:jsminified
<script type="text/javascript" src="/static/bwr/jquery/dist/jquery.min.js"></script>
//else -->
<script type="text/javascript" src="/static/bwr/jquery/dist/jquery.js"></script>
<!-- //endif -->
<!-- //if:usedebianlibs
<script type="text/javascript" src="/javascript/jquery-ui/jquery-ui.min.js"></script>
//elsif:useexternallibs
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.4/jquery-ui.min.js"></script>
//elsif:jsminified
<script type="text/javascript" src="/static/bwr/jquery-ui/jquery-ui.min.js"></script>
//else -->
<script type="text/javascript" src="/static/bwr/jquery-ui/jquery-ui.js"></script>
<!-- //endif -->
</head>
<body>
<div class="dokuwiki export container">
<!-- TOC START -->
<div id="dw__toc">
<h3 class="toggle">Table of Contents</h3>
<div>
<ul class="toc">
<li class="level1"><div class="li"><a href="#prerequisites_and_dependencies">Prerequisites and dependencies</a></div></li>
<li class="level1"><div class="li"><a href="#configuration">Configuration</a></div></li>
<li class="level1"><div class="li"><a href="#enrollment">Enrollment</a></div></li>
<li class="level1"><div class="li"><a href="#assistance">Assistance</a></div></li>
<li class="level1"><div class="li"><a href="#developer_corner">Developer corner</a></div></li>
</ul>
</div>
</div>
<!-- TOC END -->
<h1 class="sectionedit1" id="totp_2nd_factor_authentication">TOTP 2nd Factor Authentication</h1>
<div class="level1">
<p>
<a href="https://en.wikipedia.org/wiki/Time-based_One-time_Password_Algorithm" class="urlextern" title="https://en.wikipedia.org/wiki/Time-based_One-time_Password_Algorithm" rel="nofollow">Time based One Time Password</a> (TOTP) is an algorithm that computes a one-time password from a shared secret key and the current time. This is currently use by <a href="https://en.wikipedia.org/wiki/Google_Authenticator" class="urlextern" title="https://en.wikipedia.org/wiki/Google_Authenticator" rel="nofollow">Google Authenticator</a> or <a href="https://freeotp.github.io/" class="urlextern" title="https://freeotp.github.io/" rel="nofollow">FreeOTP</a>.
</p>
<p>
LLNG can propose to users to register this kind of software to increase authentication level.
</p>
<div class="notetip">Note that it&#039;s a second factor, not an authentication module. Users are authenticated both by login form and TOTP.
</div>
</div>
<!-- EDIT1 SECTION "TOTP 2nd Factor Authentication" [1-626] -->
<h2 class="sectionedit2" id="prerequisites_and_dependencies">Prerequisites and dependencies</h2>
<div class="level2">
<p>
This feature uses libconvert-base32-perl. Before enable it, on Debian you must install libconvert-base32-perl by :
</p>
<pre class="code">apt update
apt install libconvert-base32-perl
apt install libdigest-hmac-perl</pre>
<p>
Or from CPAN repository :
</p>
<pre class="code">cpanm Convert::Base32</pre>
</div>
<!-- EDIT2 SECTION "Prerequisites and dependencies" [627-943] -->
<h2 class="sectionedit3" id="configuration">Configuration</h2>
<div class="level2">
<p>
In the manager (advanced parameters), you just have to enable it:
</p>
<ul>
<li class="level1"><div class="li"> <strong>Activation</strong>: set it to “on”</div>
</li>
<li class="level1"><div class="li"> <strong>Self registration</strong>: set it to “on” if users are authorized to generate themselves a TOTP secret</div>
</li>
<li class="level1"><div class="li"> <strong>Authentication level</strong>: you can overwrite here auth level for TOTP registered users. Leave it blank keeps auth level provided by first authentication module <em>(default: 2 for user/password based modules)</em>. <strong>It is recommended to set an higher value here if you want to give access to some apps only to users enrolled</strong></div>
</li>
<li class="level1"><div class="li"> <strong>Issuer</strong>: default to portal hostname</div>
</li>
<li class="level1"><div class="li"> <strong>Interval</strong>: interval for TOTP algorithm (default: 30)</div>
</li>
<li class="level1"><div class="li"> <strong>Range</strong>: number of additional intervals to test (default: 1)</div>
</li>
<li class="level1"><div class="li"> <strong>Digits</strong>: number of digit by codes (default: 6)</div>
</li>
<li class="level1"><div class="li"> <strong>Display existing secret</strong>: display an already registered secret (default: disabled)</div>
</li>
<li class="level1"><div class="li"> <strong>Change existing secret</strong>: authorize a user to change its previoulsy registered TOTP secret</div>
</li>
<li class="level1"><div class="li"> <strong>Allow users to remove TOTP</strong>: If enabled, users can unregister TOTP.</div>
</li>
<li class="level1"><div class="li"> <strong>Lifetime</strong>: Unlimited by default. Set a Time To Live in seconds. TTL is checked at each login process if set. If TTL is expired, relative TOTP is removed.</div>
</li>
</ul>
<div class="noteimportant">If you want to use a custom rule for “activation” and want to keep self-registration, you must include this in your rule that <code>$_2fDevices =~ /“type”:\s*“TOTP”/s</code> is set, else TOTP will be required even if users are not registered. This is automatically done when “activation” is simply set to “on”.
</div>
</div>
<!-- EDIT3 SECTION "Configuration" [944-2474] -->
<h2 class="sectionedit4" id="enrollment">Enrollment</h2>
<div class="level2">
<p>
If you&#039;ve enabled self registration, users can register their keys by using <a href="https://portal/2fregisters" class="urlextern" title="https://portal/2fregisters" rel="nofollow">https://portal/2fregisters</a>
</p>
</div>
<!-- EDIT4 SECTION "Enrollment" [2475-2602] -->
<h2 class="sectionedit5" id="assistance">Assistance</h2>
<div class="level2">
<p>
If a user loses its key, you can remove it from manager Second Factor module.<em>
</em>
To enable manager Second Factor Administration Module, set <code>enabledModules</code> key in your <code>lemonldap-ng.ini</code> file :<em>
</em>
</p>
<pre class="code ini"><span class="re0"><span class="br0">&#91;</span>portal<span class="br0">&#93;</span></span>
<span class="re1">enabledModules</span> <span class="sy0">=</span><span class="re2"> conf, sessions, notifications, 2ndFA</span></pre>
</div>
<!-- EDIT5 SECTION "Assistance" [2603-2918] -->
<h2 class="sectionedit6" id="developer_corner">Developer corner</h2>
<div class="level2">
<p>
If you have another TOTP registration interface, you have to set these keys in Second Factor Devices array (JSON) in your user-database. Then map it to the _2fDevices attribute <em>(see <a href="exportedvars.html" class="wikilink1" title="documentation:2.0:exportedvars">exported variables</a>)</em>:
</p>
<pre class="code file json">[{&quot;name&quot; : &quot;MyTOTP&quot; , &quot;type&quot; : &quot;TOTP&quot; , &quot;_secret&quot; : &quot;########&quot; , &quot;epoch&quot;:&quot;1524078936&quot;}, ...]</pre>
</div>
<!-- EDIT6 SECTION "Developer corner" [2919-] --></div>
</body>
</html>