Core
API v2.x
2

createCredentials #

Creates authentication credentials for a user.


Query Syntax #

HTTP #

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

Other protocols #

Copied to clipboard!
{
  "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:

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