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.

CredentialsExistAsync #

Checks that the current user has credentials for the specified strategy.

Arguments #

public async Task<bool> CredentialsExistAsync(string strategy);
ArgumentTypeDescription
strategy
string
Strategy to use

Return #

A boolean indicating if credentials exists for the strategy.

Exceptions #

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

Usage #

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