validateCredentials

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

});

// Using promises (node.js)
kuzzle
  .security
  .validateCredentialsPromise('local', 'kuid', {'username': 'foo'})
  .then(result => {

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

kuzzle.security.validateCredentials("local", "kuid", credentials, new ResponseListener<Boolean>() {
  @Override
  public void onSuccess(Boolean result) {

  }

  @Override
  public void onError(JSONObject error) {
    // Handle error
  }
}
<?php
use \Kuzzle\Kuzzle;

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

Callback response

true

Validate credentials of the specifiedfor the user.


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

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

Options

OptionTypeDescriptionDefault
queuablebooleanMark this request as (not) queuabletrue

Callback response

Resolves to a boolean value