code | type | title |
---|---|---|
true |
page |
createMyCredentials | API | Core |
Creates new credentials for the current user.
```http URL: http://kuzzle:7512/_me/credentials//_create Method: POST Headers: Authorization: "Bearer " Body: ``` ```http URL: http://kuzzle:7512/credentials//_me/_create Method: POST Headers: Authorization: "Bearer " Body: ```
{
// example with the "local" authentication strategy
"username": "MyUser",
"password": "MyPassword"
}
{
"controller": "auth",
"action": "createMyCredentials",
"strategy": "<strategy>",
"jwt": "<authentication token>",
"body": {
"username": "MyUser",
"password": "MyPassword"
}
}
jwt
: valid authentication token (for the HTTP protocol, the token is to be passed to theAuthorization
header instead)strategy
: name of the authentication strategy to use
Credentials to be created. The properties to send will depend on the chosen authentication strategy.
The result content depends on the authentication strategy.
Example with the local
authentication strategy:
{
"status": 200,
"error": null,
"action": "createMyCredentials",
"controller": "auth",
"result": {
"username": "MyUser",
"kuid": "<kuid>"
}
}