getCredentials

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

});

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

  });
kuzzle.security.getCredentials("local", "kuid", new ResponseListener<JSONObject>() {
  @Override
  public void onSuccess(JSONObject credentials) {

  }

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

$kuzzle = new Kuzzle('localhost');
$credentials = $kuzzle->security->getCredentials('local', 'kuid');

Callback response

{
  "username": "foo", 
  "kuid": "<Kuzzle User Unique Identifier>"
}

Get credential information of the specified strategy for the specified kuid.


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

ArgumentsTypeDescription
strategystringStrategy you want to get credentials from
kuidstringUser's kuid
optionsJSON objectOptional parameters
callbackfunctionCallback handling the response

Options

OptionTypeDescriptionDefault
queuablebooleanMark this request as (not) queuabletrue

Callback response

The response is a an object reflecting the credentials.