lemonldap-ng/doc/pages/documentation/current/rest2f.html
2019-09-23 22:41:16 +02:00

130 lines
6.3 KiB
HTML

<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8" />
<title>documentation:2.0:rest2f</title>
<meta name="generator" content="DokuWiki"/>
<meta name="robots" content="index,follow"/>
<meta name="keywords" content="documentation,2.0,rest2f"/>
<link rel="search" type="application/opensearchdescription+xml" href="lib/exe/opensearch.html" title="LemonLDAP::NG"/>
<link rel="start" href="rest2f.html"/>
<link rel="contents" href="rest2f.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:rest2f","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="level2"><div class="li"><a href="#configuration">Configuration</a></div></li>
<li class="level1"><div class="li"><a href="#arguments">Arguments</a></div></li>
<li class="level1"><div class="li"><a href="#rest_dialog">REST Dialog</a></div></li>
</ul>
</div>
</div>
<!-- TOC END -->
<h1 class="sectionedit1" id="rest_second_factor">REST Second Factor</h1>
<div class="level1">
<p>
This plugin can be used to append a second factor authentication device like SMS or OTP. It uses an external web service to submit and validate the second factor.
</p>
</div>
<!-- EDIT1 SECTION "REST Second Factor" [1-198] -->
<h3 class="sectionedit2" id="configuration">Configuration</h3>
<div class="level3">
<p>
All parameters are set in &quot;General Parameters » Portal Parameters » Second Factors » REST 2nd Factor&quot;.
</p>
<ul>
<li class="level1"><div class="li"> <strong>Activation</strong></div>
</li>
<li class="level1"><div class="li"> <strong>Init <abbr title="Uniform Resource Locator">URL</abbr></strong> <em>(optional)</em>: REST <abbr title="Uniform Resource Locator">URL</abbr> to initialize dialog <em>(send OTP)</em>. Leave it blank if your <abbr title="Application Programming Interface">API</abbr> doesn&#039;t need any initialization</div>
</li>
<li class="level1"><div class="li"> <strong>Init arguments</strong>: list of arguments to send <em>(see below)</em></div>
</li>
<li class="level1"><div class="li"> <strong>Verify <abbr title="Uniform Resource Locator">URL</abbr></strong> <em>(required)</em>: REST <abbr title="Uniform Resource Locator">URL</abbr> to verify code</div>
</li>
<li class="level1"><div class="li"> <strong>Verify arguments</strong>: list of arguments to send <em>(see below)</em></div>
</li>
<li class="level1"><div class="li"> <strong>Authentication level</strong> (Optional): if you want to overwrite the value sent by your authentication module, you can define here the new authentication level. Example: 5</div>
</li>
<li class="level1"><div class="li"> <strong>Logo</strong> (Optional): logo file <em>(in static/&lt;skin&gt; directory)</em></div>
</li>
<li class="level1"><div class="li"> <strong>Label</strong> (Optional): label that should be displayed to the user on the choice screen</div>
</li>
</ul>
</div>
<!-- EDIT2 SECTION "Configuration" [199-1010] -->
<h2 class="sectionedit3" id="arguments">Arguments</h2>
<div class="level2">
<p>
Arguments are a list of key/value. Key is the name of JSON entry, value is attribute or macro name.
</p>
<div class="noteimportant">For Verify <abbr title="Uniform Resource Locator">URL</abbr>, you should send $code at least
</div>
</div>
<!-- EDIT3 SECTION "Arguments" [1011-1205] -->
<h2 class="sectionedit4" id="rest_dialog">REST Dialog</h2>
<div class="level2">
<p>
REST web services have just to reply with a &quot;result&quot; key in a JSON file. Auth/UserDB can add an &quot;info&quot; array. It will be stored in session data (without reading &quot;Exported variables&quot;).
</p>
<div class="table sectionedit5"><table class="inline table table-bordered table-striped">
<thead>
<tr class="row0 roweven">
<th class="col0 centeralign"> <abbr title="Uniform Resource Locator">URL</abbr> </th><th class="col1 centeralign"> Query </th><th class="col2 centeralign"> Response </th>
</tr>
</thead>
<tr class="row1 rowodd">
<td class="col0 centeralign"> Init <abbr title="Uniform Resource Locator">URL</abbr> </td><td class="col1"> JSON file: <code>{&quot;user&quot;:$user,...}</code> </td><td class="col2"> JSON file: <code>{&quot;result&quot;:true/false}</code> </td>
</tr>
<tr class="row2 roweven">
<td class="col0 centeralign"> Verify <abbr title="Uniform Resource Locator">URL</abbr> </td><td class="col1"> JSON file: <code>{&quot;user&quot;:$user,&quot;code&quot;:&quot;$code&quot;,...}</code> </td><td class="col2"> JSON file: <code>{&quot;result&quot;:true/false}</code> </td>
</tr>
</table></div>
<!-- EDIT5 TABLE [1416-1645] -->
</div>
<!-- EDIT4 SECTION "REST Dialog" [1206-] --></div>
</body>
</html>