Differences

This shows you the differences between two versions of the page.

Link to this comparison view

documentation:latest:authrest [2019/04/06 10:07] (current)
Line 1: Line 1:
 +====== REST ======
  
 +^  Authentication ​ ^  Users  ^  Password ​ ^
 +|  ✔  |  ✔  |  ✔  |
 +
 +===== Presentation =====
 +
 +This backend can be used to delegate authentication to some webservices.
 +
 +===== Configuration =====
 +
 +In Manager, go in ''​General Parameters''​ > ''​Authentication modules''​ and choose REST for authentication,​ users and/or password modules.
 +
 +Then, go in ''​REST parameters''​ and you just have to set REST URL to provide wanted services:
 +^  Module ​ ^  Parameter ​ ^
 +|  Authentication level  |  Authentication level for this module ​ |
 +|  Authentication ​ |  Authentication URL  |
 +|  User database ​ |  User data URL  |
 +|  Password confirmation ​ |  Password confirmation URL  |
 +|  Password change ​ |  Password change URL  |
 +
 +<note tip>You can then choose any other module for users and password.</​note>​
 +
 +===== REST Dialog =====
 +
 +REST web services have just 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"​).
 +
 +^  URL  ^  Query  ^  Response ​ ^
 +|  Authentication URL  | JSON file: ''​{"​user":​$user,"​password":​$password}''​ | JSON file: ''​{"​result":​true/​false,"​info":​{...}}''​ |
 +|  User data URL  | JSON file: ''​{"​user":​$user}''​ | JSON file: ''​{"​result":​true/​false,"​info":​{"​uid":"​dwho",​...}}''​ |
 +|  Password confirmation URL  | JSON file: ''​{"​user":​$user,"​password":​$password}''​ | JSON file: ''​{"​result":​true/​false}''​ |
 +|  Password change URL  | JSON file: ''​{"​user":​$user,"​password":​$password}''​ | JSON file: ''​{"​result":​true/​false}''​ |
 +
 +<note tip>To have just one call, you can only set REST authentication,​ set datas in "​info"​ key response and set Null as User Database.</​note>​