SDK
SDK Jvm v1.x
2

GetCurrentUserAsync #

Returns information about the user currently logged with the SDK instance.

:::: tabs ::: tab Java

Arguments #

public CompletableFuture<Map<String, Object>> getCurrentUser()
  throws NotConnectedException, InternalException

Return #

A Map representing the User.

PropertyTypeDescription
_id
String
Representing the current user kuid
strategies
Array
Available authentication strategies for that user
_source
Map
User information

Usage #

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().getCurrentUser().get();

::: ::: tab Kotlin

Arguments #

fun getCurrentUser(): CompletableFuture<Map<String, Any?>>

Return #

A Map representing the User.

PropertyTypeDescription
_id
String
Representing the current user kuid
strategies
Array
Available authentication strategies for that user
_source
Map
User information

Usage #

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

::: ::::