SDK
SDK Dart v2.x
2

updateCredentials #

Updates a user credentials for the specified authentication strategy.


 Future<Map<String, dynamic>> updateCredentials(
      String strategy, String id, Map<String, dynamic> credentials,
      {bool waitForRefresh})

PropertyTypeDescription
strategy
String
Strategy to use
id
String
User id
credentials
Map<String, dynamic>
New credentials
waitForRefresh
bool

(null)
If set to true, Kuzzle will not respond until the credentials are indexed

credentials #

The credentials to send. The expected properties depend on the target authentication strategy.

Example for the local strategy:

{
  'username': 'foo',
  'password': 'bar'
}

Return #

A Map<String, dynamic> representing the new credentials.
The content depends on the authentication strategy.

Usage #

final result = await kuzzle.security.updateCredentials(
  'local',
  'john.doe',
  {
    'username': 'jdoe',
    'password': 'newPassword'
  }
);
/*
{ username: "jdoe" }
*/