Password reset requests (pwd_reset_requests)
Overview
Manages password reset requests, as well as changing one’s own password by an authorized user.
The procedure is possible only if an external authorization script is not used.
Depending on the authorization state, the current endpoint applies one of two algorithms:
Single-step self password change algorithm
Performed after authorization.
-
1. POST request to change the password of the current authorized user.
-
1. Check for the 'current_pwd' and 'new_pwd' fields in the JSON request body.
-
2. Verify the current password is correct.
-
3. Send a change request to MDC and check the password complexity policy.
-
Two-step forgotten password recovery algorithm
Performed without authorization.
-
1. POST request to send an email with a password reset link.
-
1.1. Check for the 'key' field and optionally the domain field in the JSON request body.
-
1.2. Find the user by the key value: login or email. When specifying a login, the domain must be specified. For email it is optional.
-
1.3. Create the PwdResetRequest entity with a 1-hour lifetime limit.
-
1.4. Send an email to the user with a link containing the UUID of the password change request. The link leads to the system web application /app-root, but it contains an identifier that can be used to call the API directly with a PATCH request.
-
-
2. PATCH request to change the password.
-
2.1. Check for the 'pwd' field in the JSON request body.
-
2.2. Verify the password reset request validity based on the identifier passed in the URL.
-
2.3. Send a change request to MDC and check the password complexity policy.
-
2.4. On success, delete the PwdResetRequest entity.
-
For successful email sending, configure the mail server profile, the mail server account, and set its 'isSystem' flag.
Requests
| HTTP verb | Endpoint | Description |
|---|---|---|
|
|
|
|
|
|
|
|
Changing one’s own password (after authorization)
Request
POST /rest/v1/iam/pwd_reset_requests HTTP/1.1
Content-Type: application/json; charset=utf-8
{
"current_pwd": "25aN8Af",
"new_pwd": "A39sQ-19b"
}
Response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"error_code": 0,
"result": true,
"result_msg": "Check your email box for password reset url"
}
HTTP/1.1 412 Precondition failed
Content-Type: application/json; charset=utf-8
{
"error_code": 1501,
"error_message": "pwd contains invalid symbols. Expected: A-Za-z0-9_-.~!",
"error_details":{
"field": "pwd"
}
}
Password recovery (without authorization)
Step 1/2 of the two-step forgotten password recovery algorithm.
The request may be performed no more than once per minute from the same IP address.
Request
POST /rest/v1/iam/pwd_reset_requests HTTP/1.1
Content-Type: application/json; charset=utf-8
{
"key": "my.account@email.com"
}
POST /rest/v1/iam/pwd_reset_requests HTTP/1.1
Content-Type: application/json; charset=utf-8
{
"key": "mylogin",
"domain": "pbx.incoplax.com"
}
Response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"error_code": 0,
"result": true,
"result_msg": "Check your email box for password reset URL",
}
HTTP/1.1 412 Precondition failed
Content-Type: application/json; charset=utf-8
{
"error_code": 1413,
"error_message": "Email not found. Request your administrator to change password or setup email."
}
Replacing a forgotten password (without authorization)
Step 2/2 of the two-step forgotten password recovery algorithm.
Request
PATCH /rest/v1/iam/pwd_reset_requests/602c559c-0183-a834-ee7d-7cd30a921f58 HTTP/1.1
Content-Type: application/json; charset=utf-8
{
"pwd": "ew!hIb3V"
}
Response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"error_code": 0,
"result": true,
"result_msg": "Now login with new password",
"user": {
"domain": "pbx.incoplax.com",
"login": "mylogin"
}
}
HTTP/1.1 412 Precondition failed
Content-Type: application/json; charset=utf-8
{
"error_code": 1501,
"error_message": "pwd contains invalid symbols. Expected: A-Za-z0-9_-.~!",
"error_details":{
"field": "pwd"
}
}