SDK
SDK C# 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.

ValidateMyCredentialsAsync #

Validate the current user's credentials for the specified strategy. The result field is true if the provided credentials are valid; otherwise an error is triggered. This route does not actually create or modify the user credentials. The credentials to send will depend on the authentication plugin and authentication strategy.

Arguments #

public async Task<bool> ValidateMyCredentialsAsync(
      string strategy,
      JObject credentials);
ArgumentTypeDescription
strategy
string
Strategy to use
credentials
JObject
JObject representing the credentials

Return #

A boolean indicating if the credentials are valid.

Usage #

try {
  await kuzzle.Auth.LoginAsync(
    "local",
    JObject.Parse("{username: 'foo', password: 'bar'}"));
  bool valid = await kuzzle.Auth.ValidateMyCredentialsAsync(
    "local",
    JObject.Parse("{username: 'foo', password: 'bar'}"));
  if (valid) {
    Console.WriteLine("Credentials are valid");
  }
} catch (KuzzleException e) {
  Console.WriteLine(e);
}