Unknown SDK

UpdateMyCredentialsAsync

Update the current user's credentials for the specified strategy. The credentials to send will depend on the authentication plugin and the authentication strategy.

Arguments

Copied to clipboard!
public async Task<JObject> UpdateMyCredentialsAsync(
      string strategy,
      JObject credentials);
Argument Type Description
strategy
string
Strategy to use
credentials
JObject
JObject representing the credentials

Exceptions

Throws a KuzzleException if there is an error. See how to handle error.

Return

A JObject representing the updated credentials with the following properties:

Property Type Description
username
string
The Username
kuid
string
The user's kuid

Usage

Copied to clipboard!
try {
  await kuzzle.Auth.LoginAsync(
    "local",
    JObject.Parse("{username: 'foo', password: 'bar'}"));
  JObject response = await kuzzle.Auth.UpdateMyCredentialsAsync(
    "local",
    JObject.Parse("{username: 'foo', password: 'bar'}"));
  Console.WriteLine(response.ToString(Formatting.None));
  /*
  {
    "username": "foo",
    "kuid": "foo"
  }
  */
  Console.WriteLine("Credentials successfully updated");
} catch (KuzzleException e) {
  Console.WriteLine(e);
}