SDK
SDK Jvm v1.x
2

CreateMyCredentials #

Creates the current user's credentials for the specified strategy.

:::: tabs ::: tab Java

Arguments #

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

Return #

A Map representing the new credentials.

Usage #

Copied to clipboard!
Map<String, Object> credentials = new HashMap<>();
credentials.put("username", "foo");
credentials.put("password", "bar");
Map<String, Object> newCredentials = new HashMap<>();
newCredentials.put("username", "foo2");
newCredentials.put("password", "bar2");
Map<String, Object> response =
  kuzzle.getAuthController().login("local", credentials).get();
kuzzle.getAuthController().createMyCredentials("other", newCredentials).get();

::: ::: tab Kotlin

Arguments #

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

Return #

A Map representing the new credentials.

Usage #

Copied to clipboard!
kuzzle.authController.login("local", HashMap<String, Any?>().apply {
  put("username", "foo")
  put("password", "bar")
}).get()
kuzzle.authController.createMyCredentials("other", HashMap<String, Any?>().apply {
  put("username", "foo2")
  put("password", "bar2")
}).get()

::: ::::