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.

GetMyCredentialsAsync #

Returns the current user's credential information for the specified strategy. The data returned will depend on the specified strategy. The result can be an empty string.

Arguments #

public async Task<JObject> GetMyCredentialsAsync(string strategy);
ArgumentTypeDescription
strategy
string
Strategy to use

Return #

Returns a JObject representing the credentials for the provided authentication 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'}"));
  JObject local_credentials = await kuzzle.Auth.GetMyCredentialsAsync("local");
  Console.WriteLine(local_credentials.ToString(Formatting.None));
  /*
  {
    "username": "foo",
    "kuid": "foo"
  }
  */
  Console.WriteLine("Successfully got local credentials");
} catch (KuzzleException e) {
  Console.WriteLine(e);
}