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 #

Copied to clipboard!
CompletableFuture<Map<String, Object>> updateMyCredentials(
  String strategy,
  Map<String, Object> credentials)
  throws NotConnectedException, InternalException
Argument Type Description
strategy
String
Strategy to use
credentials
Map<String, Object>
JObject representing the credentials

Return #

A Map representing the updated credentials with the following properties:

Property Type Description
username
String
The Username
kuid
String
The user's kuid

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

::: ::: tab Kotlin

Arguments #

Copied to clipboard!
fun updateMyCredentials(
      strategy: String,
      credentials: Map<String, Any?>): CompletableFuture<Map<String, Any?>>
Argument Type Description
strategy
String
Strategy to use
credentials
Map<String, Any?>
JObject representing the credentials

Return #

A Map representing the updated credentials with the following properties:

Property Type Description
username
String
The Username
kuid
String
The user's kuid

Usage #

Copied to clipboard!
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();

::: ::::