// Using callbacks (node.js or browser)
kuzzle.security.updateCredentials('local', 'kuid', {'username': 'foo'}, function (error, updatedCredentials) {


// Using promises (node.js)
  .updateCredentialsPromise('local', 'kuid', {'username': 'foo'})
  .then(updatedCredentials => {

JSONObject credentials = new JSONObject().put("username", "foo");

kuzzle.security.updateCredentials("local", "kuid", credentials, new ResponseListener<JSONObject>() {
  public void onSuccess(JSONObject updatedCredentials) {

  public void onError(JSONObject error) {
    // Handle error
use \Kuzzle\Kuzzle;

$kuzzle = new Kuzzle('localhost');
$updatedCredentials = $kuzzle->security->updateCredentials('local', 'kuid', ['username' => 'foo']);

Callback response

  "username": "foo",
  "kuid": "<Kuzzle Unique User Identifier>"

Update credentials of the specifiedfor the current user. The credentials to send depends entirely on the authentication plugin and strategy you want to update credentials for.

updateCredentials(strategy, kuid, credentials, [options], [callback])

strategystringStrategy you want to create credentials in
kuidJSON objectUser's kuid
credentialsJSON objectThe credentials
optionsJSON objectOptional parameters
callbackfunctionOptional callback handling the response


queuablebooleanMark this request as (not) queuabletrue

Callback response

The response is a an object reflecting the updated credentials.