// Using callbacks (node.js or browser)
kuzzle.updateMyCredentials('local', {'username': 'foo'}, function (err, res) {
  console.log(res);     // {username: 'bar', kuid: '<kuid>'}

// Using promises (node.js)
  .updateMyCredentials('local', {'username': 'foo'})
  .then(res => {
    console.log(res);   // {username: 'foo', kuid: '<kuid>'}
JSONObject credentials = new JSONObject().put("username", "bar");

kuzzle.updateMyCredentials("local", credentials, new ResponseListener<JSONObject>() {
  public void onSuccess(JSONObject result) {
    // result var contains the updated credentials and the kuid of the user

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

$kuzzle = new Kuzzle('localhost');
$result = $kuzzle->updateMyCredentials('local', ['username' => 'foo']);

// $result = [username => 'foo', kuid => '<kuid>']

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.

updateMyCredentials(strategy, credentials, [options], [callback])

strategystringStrategy you want to create credentials in
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.