SDK
SDK Jvm v1.x
2

GetMyCredentials #

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

:::: tabs ::: tab Java

Arguments #

Copied to clipboard!
public CompletableFuture<Map<String, Object>> getMyCredentials(String strategy)
  throws NotConnectedException, InternalException
Argument Type Description
strategy
String
Strategy to use

Return #

Returns a Map representing the credentials for the provided authentication strategy.

Usage #

Copied to clipboard!
Map<String, Object> credentials = new HashMap<>();
credentials.put("username", "foo");
credentials.put("password", "bar");
kuzzle.getAuthController().login("local", credentials).get();
Map<String, Object> result =
  kuzzle.getAuthController().getMyCredentials("local").get();

::: ::: tab Kotlin

Arguments #

Copied to clipboard!
fun getMyCredentials(
      strategy: String): CompletableFuture<Map<String, Any?>>
Argument Type Description
strategy
String
Strategy to use

Return #

Returns a Map representing the credentials for the provided authentication strategy.

Usage #

Copied to clipboard!
kuzzle.authController.login("local", HashMap<String, Any?>().apply {
  put("username", "foo")
  put("password", "bar")
}).get()
val result: Map<String, Any?> =
  kuzzle.authController.getMyCredentials("local").get()

::: ::::