All methods and paths for this operation:
Change the passwords of users in the native realm and built-in users.
The user whose password you want to change. If you do not specify this parameter, the password is changed for the current user.
If true (the default) then refresh the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false then do nothing with refreshes.
Values are true, false, or wait_for.
POST /_security/user/jacknich/_password
{
"password" : "new-test-password"
}
resp = client.security.change_password(
username="jacknich",
password="new-test-password",
)
const response = await client.security.changePassword({
username: "jacknich",
password: "new-test-password",
});
response = client.security.change_password(
username: "jacknich",
body: {
"password": "new-test-password"
}
)
$resp = $client->security()->changePassword([
"username" => "jacknich",
"body" => [
"password" => "new-test-password",
],
]);
curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d '{"password":"new-test-password"}' "$ELASTICSEARCH_URL/_security/user/jacknich/_password"
client.security().changePassword(c -> c
.password("new-test-password")
.username("jacknich")
);
{
"password" : "new-test-password"
}