| 1 |
Password Initialization Reset Plugin |
| 2 |
==================================== |
| 3 |
|
| 4 |
This plugin can be used to initialize a reset password for a user. |
| 5 |
|
| 6 |
It is used by: |
| 7 |
|
| 8 |
- :doc:`password reset by mail<resetpassword>` |
| 9 |
|
| 10 |
Configuration |
| 11 |
------------- |
| 12 |
|
| 13 |
Browse the Manager web interface for this configuration. |
| 14 |
|
| 15 |
Enable the plugin in ``General Parameters > Plugins > Initialize Password Reset API plugin``: |
| 16 |
|
| 17 |
- **Activation**: Enable / Disable this plugin |
| 18 |
- **Secret key**: Secret key for the Initialize Password Reset API |
| 19 |
|
| 20 |
.. note:: |
| 21 |
|
| 22 |
Take care to define a userDB module. The plugin does not work currently with Choice module. |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
Usage |
| 27 |
----- |
| 28 |
|
| 29 |
When enabled, ``/initializepasswordreset`` route is added to LemonLDAP API. |
| 30 |
It will generate a mail session, usable for reinitializating a password by mail for a given user. |
| 31 |
|
| 32 |
.. danger:: |
| 33 |
|
| 34 |
The secret key parameter is mandatory, and there is no default value. |
| 35 |
|
| 36 |
|
| 37 |
Send a REST request with parameters `mail` and `secret` in JSON. |
| 38 |
|
| 39 |
For example: |
| 40 |
|
| 41 |
.. code-block:: console |
| 42 |
|
| 43 |
curl -s -X POST -H "Content-Type: application/json" -d '{"mail":"[email protected]","secret":"mysecret"}' https://auth.domain.com/initializepasswordreset | jq . |
| 44 |
|
| 45 |
Result: |
| 46 |
|
| 47 |
.. code-block:: console |
| 48 |
|
| 49 |
{ |
| 50 |
"url": "http://auth.domain.com/resetpwd?mail_token=8c717a2eb8233a95181846e0db29791c20c0b2dbbeab60ab5ae155559511a1d4", |
| 51 |
"mail_token": "8c717a2eb8233a95181846e0db29791c20c0b2dbbeab60ab5ae155559511a1d4" |
| 52 |
} |
| 53 |
|