Core
API v2.x
2

createCredentials #

Creates authentication credentials for a user.


Query Syntax #

HTTP #

URL: http://kuzzle:7512/credentials/<strategy>/<_id>/_create
Method: POST
Body:
{
  // example for the "local" authentication strategy
  "username": "MyUser",
  "password": "MyPassword"
}

Other protocols #

{
  "controller": "security",
  "action": "createCredentials",
  "strategy": "<strategy>",
  "_id": "<kuid>",
  "body": {
    // example for the "local" authentication strategy
    "username": "MyUser",
    "password": "MyPassword"
  }
}

Arguments #

  • _id: user unique kuid
  • strategy: name of the target authentication strategy for the credentials

Body properties #

The credentials to send. The expected properties depend on the target authentication strategy.


Response #

The result content depends on the authentication strategy.

Example with the local authentication strategy:

{
  "status": 200,
  "error": null,
  "action": "createCredentials",
  "controller": "security",
  "_id": "<kuid>",
  "result": {
    "username": "MyUser",
    "kuid": "<kuid>"
  }
}