| 1 |
REST Second Factor |
| 2 |
================== |
| 3 |
|
| 4 |
This plugin can be used to append a second factor authentication device |
| 5 |
like SMS or OTP. It uses an external web service to submit and validate |
| 6 |
the second factor. |
| 7 |
|
| 8 |
Configuration |
| 9 |
~~~~~~~~~~~~~ |
| 10 |
|
| 11 |
All parameters are set in "General Parameters » Portal Parameters » |
| 12 |
Second Factors » REST 2nd Factor". |
| 13 |
|
| 14 |
- **Activation** |
| 15 |
- **Code regex**: regular expression to create an OTP code. If this option is |
| 16 |
set, LemonLDAP::NG will generate the code and send it through the Init URL, |
| 17 |
then verify it internally. |
| 18 |
- **Init URL** *(optional)*: REST URL to initialize dialog *(send |
| 19 |
OTP)*. Leave it blank if your API doesn't need any initialization |
| 20 |
- **Init arguments**: list of arguments to send *(see below)* |
| 21 |
- **Verify URL** *(required)*: REST URL to verify code |
| 22 |
- **Verify arguments**: list of arguments to send *(see below)* |
| 23 |
- **Re-send interval**: Set this to a non-empty value to allow the user to |
| 24 |
re-send the code in case a transmission error occured. The value sets how |
| 25 |
many seconds the user has to wait before each attempt |
| 26 |
- **Authentication level** (Optional): if you want to overwrite the |
| 27 |
value sent by your authentication module, you can define here the new |
| 28 |
authentication level. Example: 5 |
| 29 |
- **Label** (Optional): label that should be displayed to the user on |
| 30 |
the choice screen |
| 31 |
- **Logo** (Optional): logo file *(in static/<skin> directory)* |
| 32 |
|
| 33 |
Arguments |
| 34 |
--------- |
| 35 |
|
| 36 |
Arguments are a list of key/value. Key is the name of JSON entry, value |
| 37 |
is attribute or macro name. |
| 38 |
|
| 39 |
.. versionchanged:: 2.23.0 |
| 40 |
The value can also be a :doc:`Perl expression <writingrulesand_headers>` |
| 41 |
|
| 42 |
REST Dialog |
| 43 |
----------- |
| 44 |
|
| 45 |
|
| 46 |
REST web services have just to reply with a "result" key in a JSON file. |
| 47 |
Auth/UserDB can add an "info" array. It will be stored in session data |
| 48 |
(without reading "Exported variables"). |
| 49 |
|
| 50 |
If *Code regex* is set |
| 51 |
~~~~~~~~~~~~~~~~~~~~~~ |
| 52 |
|
| 53 |
========== ================================================ ==================================== |
| 54 |
URL Query Response |
| 55 |
========== ================================================ ==================================== |
| 56 |
Init URL JSON body: ``{"user":$user,"code":"$code",...}`` JSON body: ``{"result":true/false}`` |
| 57 |
========== ================================================ ==================================== |
| 58 |
|
| 59 |
The Verify URL is not called, since the code is checked against the internally saved value |
| 60 |
|
| 61 |
If *Code regex* is not set |
| 62 |
~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 63 |
|
| 64 |
========== ================================================ ==================================== |
| 65 |
URL Query Response |
| 66 |
========== ================================================ ==================================== |
| 67 |
Init URL JSON body: ``{"user":$user,...}`` JSON body: ``{"result":true/false}`` |
| 68 |
Verify URL JSON body: ``{"user":$user,"code":"$code",...}`` JSON body: ``{"result":true/false}`` |
| 69 |
========== ================================================ ==================================== |