Core
API v1.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

getCredentialsById #

Gets credential information for the user identified by the strategy's unique user identifier userId.

The returned result object will vary depending on the strategy (see the getById plugin function), and it can be empty.

Note: the user identifier to use depends on the specified strategy. If you wish to get credential information using a kuid identifier, use the getCredentials API route instead.


Query Syntax #

HTTP #

URL: http://kuzzle:7512/credentials/<strategy>/<_id>/_byId
Method: GET

Other protocols #

{
  "controller": "security",
  "action": "getCredentialsById",
  "strategy": "<strategy>",
  "_id": "<userId>"
}

Arguments #

  • _id: user credential identifier (this is NOT the kuid)
  • strategy: authentication strategy

Response #

Returns credentials information (depend on the authentication strategy).

Example with the "local" authentication strategy: #

{
  "status": 200,
  "error": null,
  "action": "getCredentialsById",
  "controller": "security",
  "result": {
    "username": "<userId>",
    "kuid": "<kuid>"
  }
}