Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

User password management

Michał B edited this page Sep 19, 2018 · 5 revisions

Password update

Important information

  • Available at URI: http://localhost:5000/user-management/users/{id}/password
  • Type of success response: 204 No Content
  • Type of error response:
    • 400 with error message
    • 403 Forbidden
  • HTTP method type: PUT

Sending data

  • The data is sent in JSON format.
  • Request body consists of:
    • password: ulong representing the current password hash, parsed to the string format
    • newPassword: ulong representing new password hash, parsed to the string format

Example of the valid JSON request body:

{
    "password": "1201300456785202340",
    "newPassword": "1202580291580102340"
}

Receiving data

  • If all data in JSON request are valid and the password was successfully updated, then WebAPI returns 204 No Content
  • If data aren't valid or the user doesn't exist, the WebAPI returns 400 Bad Request with an error message.

For example, when the WebAPI receives not valid data:

{
    "Password": [
        "The length of 'Password' must be 20 characters or fewer. You entered 23 characters.",
        "Invalid value!"
    ],
    "NewPassword": [
        "The length of 'New Password' must be 20 characters or fewer. You entered 23 characters.",
        "Invalid value!"
    ]
}

Clone this wiki locally