SDK
SDK Jvm v1.x
2

UpdateMyCredentials #

Updates the current user's credentials for the specified strategy. The credentials to send will depend on the authentication plugin and the authentication strategy.

:::: tabs ::: tab Java

Arguments #

CompletableFuture<Map<String, Object>> updateMyCredentials(
  String strategy,
  Map<String, Object> credentials)
  throws NotConnectedException, InternalException
ArgumentTypeDescription
strategy
String
Strategy to use
credentials
Map<String, Object>
JObject representing the credentials

Return #

A Map representing the updated credentials with the following properties:

PropertyTypeDescription
username
String
The Username
kuid
String
The user's kuid

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().updateMyCredentials("local", credentials).get();

::: ::: tab Kotlin

Arguments #

fun updateMyCredentials(
      strategy: String,
      credentials: Map<String, Any?>): CompletableFuture<Map<String, Any?>>
ArgumentTypeDescription
strategy
String
Strategy to use
credentials
Map<String, Any?>
JObject representing the credentials

Return #

A Map representing the updated credentials with the following properties:

PropertyTypeDescription
username
String
The Username
kuid
String
The user's kuid

Usage #

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

::: ::::