ValidateMyCredentials #
Validates the current user's credentials for the specified strategy. This method returns true
if the provided credentials are valid; otherwise an error is triggered. This route does not actually create or modify the user credentials. The credentials to send will depend on the authentication plugin and authentication strategy.
:::: tabs ::: tab Java
Arguments #
CompletableFuture<Boolean> validateMyCredentials(final String strategy,
final Map<String, Object> credentials)
throws NotConnectedException, InternalException
Argument | Type | Description |
---|---|---|
strategy | String | Strategy to use |
credentials | Map<String, Object> | A Hashmap representing the credentials |
Return #
A Boolean indicating if the credentials are valid.
Usage #
Map<String, Object> credentials = new HashMap<>();
credentials.put("username", "foo");
credentials.put("password", "bar");
kuzzle.getAuthController().login("local", credentials).get();
Boolean result = kuzzle.getAuthController().validateMyCredentials("local", credentials).get();
::: ::: tab Kotlin
Arguments #
fun validateMyCredentials(strategy: String,
credentials: Map<String, Any?>): CompletableFuture<Boolean>
Argument | Type | Description |
---|---|---|
strategy | String | Strategy to use |
credentials | Map<String, Any?> | A Hashmap representing the credentials |
Return #
A Boolean indicating if the credentials are valid.
Usage #
val credentials = HashMap<String, Any?>().apply {
put("username", "foo")
put("password", "bar")
}
kuzzle.authController.login("local", credentials).get()
val result: Boolean = kuzzle.authController.validateMyCredentials("local", credentials).get();
::: ::::
Edit this page on Github(opens new window)