user

Instantiates a new User object.


user(id, content)

Arguments Type Description
id string Unique user identifier
content JSON Object User content

Return value

Returns the new User object.

Usage

Copied to clipboard!
var userContent = {
  // A "profileIds" field is required to bind a user to an existing profile
  profileIds: ['some profile'],

  // The "local" authentication strategy requires a password
  password: 'secretPassword',

  // You can also set custom fields to your user
  firstname: 'John',
  lastname: 'Doe'
};

var user = kuzzle.security.user('myuser', userContent);