secondfactor.html 8.09 KB
Newer Older
Xavier Guimard's avatar
Xavier Guimard committed
1 2 3 4 5 6
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
  <meta charset="utf-8" />
  <title>documentation:2.0:secondfactor</title>
<meta name="generator" content="DokuWiki"/>
Xavier Guimard's avatar
Xavier Guimard committed
7
<meta name="robots" content="index,follow"/>
Xavier Guimard's avatar
Xavier Guimard committed
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
<meta name="keywords" content="documentation,2.0,secondfactor"/>
<link rel="search" type="application/opensearchdescription+xml" href="lib/exe/opensearch.html" title="LemonLDAP::NG"/>
<link rel="start" href="secondfactor.html"/>
<link rel="contents" href="secondfactor.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:secondfactor","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">
Xavier Guimard's avatar
Xavier Guimard committed
46 47 48 49
<!-- TOC START -->
<div id="dw__toc">
<h3 class="toggle">Table of Contents</h3>
<div>
Xavier Guimard's avatar
Xavier Guimard committed
50

Xavier Guimard's avatar
Xavier Guimard committed
51 52 53 54 55 56 57 58
<ul class="toc">
<li class="level1"><div class="li"><a href="#providing_tokens_from_an_external_source">Providing tokens from an external source</a></div>
<ul class="toc">
<li class="level2"><div class="li"><a href="#u2f_tokens">U2F Tokens</a></div></li>
<li class="level2"><div class="li"><a href="#totp_tokens">TOTP Tokens</a></div></li>
<li class="level2"><div class="li"><a href="#yubikey_tokens">Yubikey Tokens</a></div></li>
</ul>
</li>
Xavier Guimard's avatar
Xavier Guimard committed
59
<li class="level1"><div class="li"><a href="#developer_corner">Developer corner</a></div></li>
Xavier Guimard's avatar
Xavier Guimard committed
60 61 62 63 64 65
</ul>
</div>
</div>
<!-- TOC END -->

<h1 class="sectionedit1" id="second_factors">Second Factors</h1>
Xavier Guimard's avatar
Xavier Guimard committed
66 67 68
<div class="level1">

<p>
Xavier Guimard's avatar
Xavier Guimard committed
69
Two-Factor Authentication <em>(as known as 2FA)</em> is a kind (subset) of <a href="https://en.wikipedia.org/wiki/Multi-factor_authentication" class="urlextern" title="https://en.wikipedia.org/wiki/Multi-factor_authentication"  rel="nofollow">multi-factor authentication</a>. It is a method to confirm a user&#039;s claimed identity by using a combination of two different factors between:
Xavier Guimard's avatar
Xavier Guimard committed
70 71
</p>
<ol>
Xavier Guimard's avatar
Xavier Guimard committed
72
<li class="level1"><div class="li"> something they know <em>(login / password, …)</em></div>
Xavier Guimard's avatar
Xavier Guimard committed
73
</li>
Xavier Guimard's avatar
Xavier Guimard committed
74
<li class="level1"><div class="li"> something they have <em>(U2F Key, smartphone, …) </em> </div>
Xavier Guimard's avatar
Xavier Guimard committed
75
</li>
Xavier Guimard's avatar
Xavier Guimard committed
76
<li class="level1"><div class="li"> something they are <em>(biometrics like fingerprints, …)</em></div>
Xavier Guimard's avatar
Xavier Guimard committed
77 78 79 80
</li>
</ol>

<p>
Xavier Guimard's avatar
Xavier Guimard committed
81
Since 2.0, LLNG provides some second factor plugins that can be used to complete authentication module with 2FA :
Xavier Guimard's avatar
Xavier Guimard committed
82 83 84 85
</p>
<ul>
<li class="level1"><div class="li"> <a href="u2f.html" class="wikilink1" title="documentation:2.0:u2f">U2F tokens</a></div>
</li>
Xavier Guimard's avatar
Xavier Guimard committed
86
<li class="level1"><div class="li"> <a href="totp2f.html" class="wikilink1" title="documentation:2.0:totp2f">TOTP</a> <em>(to use with <a href="https://freeotp.github.io/" class="urlextern" title="https://freeotp.github.io/"  rel="nofollow">FreeOTP</a>, <a href="https://en.wikipedia.org/wiki/Google_Authenticator" class="urlextern" title="https://en.wikipedia.org/wiki/Google_Authenticator"  rel="nofollow">Google-Authenticator</a>,…)</em></div>
Xavier Guimard's avatar
Xavier Guimard committed
87 88 89
</li>
<li class="level1"><div class="li"> <a href="utotp2f.html" class="wikilink1" title="documentation:2.0:utotp2f">U2F-or-TOTP</a> <em>(enable both U2F and TOTP)</em></div>
</li>
Xavier Guimard's avatar
Xavier Guimard committed
90
<li class="level1"><div class="li"> <a href="yubikey2f.html" class="wikilink1" title="documentation:2.0:yubikey2f">Yubikey tokens</a> <em> provide by Yubico</em> </div>
Xavier Guimard's avatar
Xavier Guimard committed
91
</li>
Xavier Guimard's avatar
Xavier Guimard committed
92
<li class="level1"><div class="li"> <a href="rest2f.html" class="wikilink1" title="documentation:2.0:rest2f">REST</a> <em>(Remote REST app)</em> </div>
Xavier Guimard's avatar
Xavier Guimard committed
93
</li>
Xavier Guimard's avatar
Xavier Guimard committed
94
<li class="level1"><div class="li"> <a href="external2f.html" class="wikilink1" title="documentation:2.0:external2f">External 2F</a> <em>(to call an external command)</em> </div>
Xavier Guimard's avatar
Xavier Guimard committed
95 96
</li>
</ul>
Clément OUDOT's avatar
Clément OUDOT committed
97 98
<div class="notetip">If you want to force a 2F registration on first login, you can use “Require 2FA”. You can also use a rule to force 2FA registration only for some users.
</div>
Xavier Guimard's avatar
Xavier Guimard committed
99
</div>
Clément OUDOT's avatar
Clément OUDOT committed
100
<!-- EDIT1 SECTION "Second Factors" [1-1165] -->
Xavier Guimard's avatar
Xavier Guimard committed
101
<h2 class="sectionedit2" id="providing_tokens_from_an_external_source">Providing tokens from an external source</h2>
Xavier Guimard's avatar
Xavier Guimard committed
102 103 104
<div class="level2">

<p>
Xavier Guimard's avatar
Xavier Guimard committed
105 106 107 108 109
If you don&#039;t want to use self-registration features for U2F, TOTP and so on, you can set tokens by yourself <em>(in your LDAP server for example)</em> and map it to <code>_2fDevices</code> attribute. <code>_2fDevices</code> is a JSON array that contains token descriptions :
</p>
<pre class="code json">[ {&quot;type&quot; : &quot;TOTP&quot;, &quot;name&quot; : &quot;MyTOTP&quot;, …}, {&lt;other_token&gt;}, …]</pre>

</div>
Clément OUDOT's avatar
Clément OUDOT committed
110
<!-- EDIT2 SECTION "Providing tokens from an external source" [1166-1559] -->
Xavier Guimard's avatar
Xavier Guimard committed
111 112 113 114 115
<h3 class="sectionedit3" id="u2f_tokens">U2F Tokens</h3>
<div class="level3">
<pre class="code json">{&quot;name&quot; : &quot;MyU2FKey&quot; , &quot;type&quot; : &quot;U2F&quot; , &quot;_userKey&quot; : &quot;########&quot; , &quot;_keyHandle&quot;:&quot;########&quot; , &quot;epoch&quot;:&quot;1524078936&quot;}</pre>

</div>
Clément OUDOT's avatar
Clément OUDOT committed
116
<!-- EDIT3 SECTION "U2F Tokens" [1560-1717] -->
Xavier Guimard's avatar
Xavier Guimard committed
117 118 119 120 121
<h3 class="sectionedit4" id="totp_tokens">TOTP Tokens</h3>
<div class="level3">
<pre class="code json">{&quot;name&quot; : &quot;MyTOTP&quot; , &quot;type&quot; : &quot;TOTP&quot; , &quot;_secret&quot; : &quot;########&quot; , &quot;epoch&quot; : &quot;1523817955&quot;}</pre>

</div>
Clément OUDOT's avatar
Clément OUDOT committed
122
<!-- EDIT4 SECTION "TOTP Tokens" [1718-1850] -->
Xavier Guimard's avatar
Xavier Guimard committed
123 124 125 126 127
<h3 class="sectionedit5" id="yubikey_tokens">Yubikey Tokens</h3>
<div class="level3">
<pre class="code json">{&quot;name&quot; : &quot;MyYubikey&quot; , &quot;type&quot; : &quot;UBK&quot; , &quot;_yubikey&quot; : &quot;########&quot; , &quot;epoch&quot; : &quot;1523817715&quot;}</pre>

</div>
Clément OUDOT's avatar
Clément OUDOT committed
128
<!-- EDIT5 SECTION "Yubikey Tokens" [1851-1989] -->
Xavier Guimard's avatar
Xavier Guimard committed
129
<h2 class="sectionedit6" id="developer_corner">Developer corner</h2>
Xavier Guimard's avatar
Xavier Guimard committed
130 131 132
<div class="level2">

<p>
Xavier Guimard's avatar
Xavier Guimard committed
133
To develop a new 2FA plugin, read <code>Lemonldap::NG::Portal::Main::SecondFactor (3pm)</code> manpage. Your 2F module must be a Perl class named <code>Lemonldap::NG::Portal::2F::<em>&lt;custom_name&gt;</em></code>. To enable it, set <code>available2F</code> key in your <code>lemonldap-ng.ini</code> file :
Xavier Guimard's avatar
Xavier Guimard committed
134 135 136 137
</p>
<pre class="code ini"><span class="re0"><span class="br0">&#91;</span>portal<span class="br0">&#93;</span></span>
<span class="re1">available2F</span> <span class="sy0">=</span><span class="re2"> U2F,TOTP,&lt;custom_name&gt;</span></pre>

Xavier Guimard's avatar
Xavier Guimard committed
138 139 140 141 142 143
<p>
To enable manager Second Factor Administration Module, set <code>enabledModules</code> key in your <code>lemonldap-ng.ini</code> file : 
</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>

Xavier Guimard's avatar
Xavier Guimard committed
144
</div>
Clément OUDOT's avatar
Clément OUDOT committed
145
<!-- EDIT6 SECTION "Developer corner" [1990-] --></div>
Xavier Guimard's avatar
Xavier Guimard committed
146 147
</body>
</html>