setCredentials

user.setCredentials({
  '<strategy name>': {
    some: 'credentials'
  }
});
JSONObject
  strategyCredentials = new JSONObject().put("some", "credentials"),
  credentials = new JSONObject().put("<strategy name>", strategyCredentials);

user.setCredentials(credentials);
<?php

use Kuzzle\Security\User;


/*
 * @var $user User
 */

// Updating the profile with a Profile object
$user->setCredentials([
    '<strategy name>' => [
        'some' => 'credentials'
    ]
]);

Sets the credentials associated to a user


setCredentials(credentials)

ArgumentsTypeDescription
credentialsobjectAn object containing an attribute for each strategy you want to create for the user.

Return value

Returns the User object.