Core
API v2.x
2

updateMyCredentials #

Updates the credentials of the currently logged in user.


Query Syntax #

HTTP #

Available since 2.4.0
Copied to clipboard!
URL: http://kuzzle:7512/_me/credentials/<strategy>/_update
Method: PUT
Headers: Authorization: "Bearer <authentication token>"
Body:
Deprecated since 2.4.0
Copied to clipboard!
URL: http://kuzzle:7512/credentials/<strategy>/_me/_update
Method: PUT
Headers: Authorization: "Bearer <authentication token>"
Body:
Copied to clipboard!
{
  "password": "MyPassword"
}

Other protocols #

Copied to clipboard!
{
  "controller": "auth",
  "action": "updateMyCredentials",
  "strategy": "<strategy>",
  "jwt": "<authentication token>",
  "body": {
    "password": "MyPassword"
  }
}

Arguments #

  • jwt: valid authentication token (for the HTTP protocol, the token is to be passed to the Authorization header instead)
  • strategy: name of the authentication strategy to update

Body properties #

The body contains the credential properties to update, and their new values.

The properties that can be updated depend on the chosen authentication strategy.

The API request examples in this page are for the local authentication plugin.


Response #

The result content depends on the authentication strategy.

Example with the "local" authentication strategy:

Copied to clipboard!
{
  "status": 200,
  "error": null,
  "action": "updateMyCredentials",
  "controller": "auth",
  "result": {
    "username": "MyUser",
    "kuid": "<kuid>"
  }
}