hasCredentials

// Using callbacks (node.js or browser)
kuzzle.security.hasCredentials('local', 'kuid', function (error, result) {

});

// Using promises (node.js)
kuzzle
  .security
  .hasCredentialsPromise('local', 'kuid')
  .then(result => {

  });
kuzzle.security.hasCredentials("local", "kuid", 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->hasCredentials('local', 'kuid');

// $result is a boolean

Checks if a user has credentials associated with the provided strategy.


hasCredentials(strategy, kuid, [options], callback)

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

Options

OptionTypeDescriptionDefault
queuablebooleanMark this request as (not) queuabletrue

Callback response

Resolves to a boolean value.