authrest.html 6.94 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:authrest</title>
<meta name="generator" content="DokuWiki"/>
Xavier Guimard's avatar
Xavier Guimard committed
7
<meta name="robots" content="noindex,nofollow"/>
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
<meta name="keywords" content="documentation,2.0,authrest"/>
<link rel="search" type="application/opensearchdescription+xml" href="lib/exe/opensearch.html" title="LemonLDAP::NG"/>
<link rel="start" href="authrest.html"/>
<link rel="contents" href="authrest.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:authrest","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
Xavier Guimard's avatar
Xavier Guimard committed
39
  <script type="text/javascript" src="/static/bwr/jquery-ui/jquery-ui.min.js"></script>
Xavier Guimard's avatar
Xavier Guimard committed
40
//else -->
Xavier Guimard's avatar
Xavier Guimard committed
41
  <script type="text/javascript" src="/static/bwr/jquery-ui/jquery-ui.js"></script>
Xavier Guimard's avatar
Xavier Guimard committed
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
<!-- //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="#presentation">Presentation</a></div></li>
<li class="level1"><div class="li"><a href="#configuration">Configuration</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">REST</h1>
<div class="level1">
<div class="table sectionedit2"><table class="inline table table-bordered table-striped">
	<thead>
	<tr class="row0 roweven">
		<th class="col0 centeralign">  Authentication  </th><th class="col1 centeralign">  Users  </th><th class="col2 centeralign">  Password  </th>
	</tr>
	</thead>
	<tr class="row1 rowodd">
		<td class="col0 centeralign"></td><td class="col1 centeralign"></td><td class="col2 centeralign"></td>
	</tr>
</table></div>
<!-- EDIT2 TABLE [21-90] -->
</div>
<!-- EDIT1 SECTION "REST" [1-91] -->
<h2 class="sectionedit3" id="presentation">Presentation</h2>
<div class="level2">

<p>
This backend can be used to delegate authentication to some webservices.
</p>

</div>
<!-- EDIT3 SECTION "Presentation" [92-191] -->
<h2 class="sectionedit4" id="configuration">Configuration</h2>
<div class="level2">

<p>
In Manager, go in <code>General Parameters</code> &gt; <code>Authentication modules</code> and choose REST for authentication, users and/or password modules.
</p>

<p>
Then you just have to set REST <abbr title="Uniform Resource Locator">URL</abbr> to provide wanted services:
</p>
<div class="table sectionedit5"><table class="inline table table-bordered table-striped">
	<thead>
	<tr class="row0 roweven">
		<th class="col0 centeralign">  Module  </th><th class="col1 centeralign">  Parameter  </th>
	</tr>
	</thead>
	<tr class="row1 rowodd">
		<td class="col0 centeralign">  Authentication  </td><td class="col1 centeralign">  Authentication <abbr title="Uniform Resource Locator">URL</abbr>  </td>
	</tr>
	<tr class="row2 roweven">
		<td class="col0 centeralign">  User database  </td><td class="col1 centeralign">  User data <abbr title="Uniform Resource Locator">URL</abbr>  </td>
	</tr>
	<tr class="row3 rowodd">
		<td class="col0 centeralign">  Password  </td><td class="col1 centeralign">  Password confirmation <abbr title="Uniform Resource Locator">URL</abbr>  </td>
	</tr>
	<tr class="row4 roweven">
		<td class="col0 centeralign">  Password  </td><td class="col1 centeralign">  Password change <abbr title="Uniform Resource Locator">URL</abbr>  </td>
	</tr>
</table></div>
<!-- EDIT5 TABLE [420-612] -->
</div>
<!-- EDIT4 SECTION "Configuration" [192-613] -->
<h2 class="sectionedit6" id="rest_dialog">REST Dialog</h2>
<div class="level2">

<p>
Xavier Guimard's avatar
Xavier Guimard committed
120
REST web services just have to respond with a “result” key in a JSON file. Auth/UserDB can add an “info” array that will be stored in session data (without reading “Exported variables”).
Xavier Guimard's avatar
Xavier Guimard committed
121 122 123 124
</p>
<div class="table sectionedit7"><table class="inline table table-bordered table-striped">
	<thead>
	<tr class="row0 roweven">
Xavier Guimard's avatar
Xavier Guimard committed
125
		<th class="col0 centeralign">  <abbr title="Uniform Resource Locator">URL</abbr>  </th><th class="col1 centeralign">  Query  </th><th class="col2 centeralign">  Response  </th>
Xavier Guimard's avatar
Xavier Guimard committed
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
	</tr>
	</thead>
	<tr class="row1 rowodd">
		<td class="col0 centeralign">  Authentication <abbr title="Uniform Resource Locator">URL</abbr>  </td><td class="col1"> JSON file: <code>{“user”:$user,“password”:$password}</code> </td><td class="col2"> JSON file: <code>{“result”:true/false,“info”:{…}}</code> </td>
	</tr>
	<tr class="row2 roweven">
		<td class="col0 centeralign">  User data <abbr title="Uniform Resource Locator">URL</abbr>  </td><td class="col1"> JSON file: <code>{“user”:$user}</code> </td><td class="col2"> JSON file: <code>{“result”:true/false,“info”:{“uid”:“dwho”,…}}</code> </td>
	</tr>
	<tr class="row3 rowodd">
		<td class="col0 centeralign">  Password confirmation <abbr title="Uniform Resource Locator">URL</abbr>  </td><td class="col1"> JSON file: <code>{“user”:$user,“password”:$password}</code> </td><td class="col2"> JSON file: <code>{“result”:true/false}</code> </td>
	</tr>
	<tr class="row4 roweven">
		<td class="col0 centeralign">  Password change <abbr title="Uniform Resource Locator">URL</abbr>  </td><td class="col1"> JSON file: <code>{“user”:$user,“password”:$password}</code> </td><td class="col2"> JSON file: <code>{“result”:true/false}</code> </td>
	</tr>
</table></div>
Xavier Guimard's avatar
Xavier Guimard committed
141
<!-- EDIT7 TABLE [827-1348] --><div class="notetip">To have just one call, you can only set REST authentication, set datas in “info” key response and set Null as User Database.
Xavier Guimard's avatar
Xavier Guimard committed
142 143 144 145 146
</div>
</div>
<!-- EDIT6 SECTION "REST Dialog" [614-] --></div>
</body>
</html>