API-Version
v2
Request-Methode
PUT
Operation-ID
user-change-password
If a second factor is set up, provide either multiFactorCode or passkeyCredential.
Request
Responses
Nutzungsbeispiele
$ curl \
--fail \
--location \
-X PUT \
-d '{"multiFactorCode":"123456","newPassword":"string","oldPassword":"string","passkeyCredential":{"challengeId":"6a1f0b1e-7d0c-4a43-9c1f-4f6c9b0f7a11","credential":{"authenticatorAttachment":"platform","clientExtensionResults":{},"id":"AN29uP9UVfVZ1X0WLKg3zA","rawId":"AN29uP9UVfVZ1X0WLKg3zA","response":{"authenticatorData":"8q2Xwa9qKcqUca3Qox8O-H9rqwjlNp1O5WHPOETZnigdAAAAAA","clientDataJSON":"eyJ0eXBlIjoid2ViYXV0aG4uZ2V0IiwiY2hhbGxlbmdlIjoicmNVYTE2MzRZVWFDc0JlYXNyb1RWdWRCYjRqTlNuS3pUR3pKOUVkTGxyQSIsIm9yaWdpbiI6Imh0dHBzOi8vc3R1ZGlvLm1pdHR3YWxkLmRlIiwiY3Jvc3NPcmlnaW4iOmZhbHNlfQ","signature":"MEUCIQD7nQ352E7fNAwHcgq5mMDsoeHQ0odAgekdw9tbs-Lc1gIgSBt2yLdJV_AcNx76CMsEP-S7LoJ_E0q-y19EAEWtwLI","userHandle":"NmMxYzFkMGUtNmYwZS00YTNjLTlkM2YtNWYyZDFkMGI5YTEx"},"type":"public-key"}}}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/users/self/credentials/password
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";
const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.user.changePassword({
"data": {
"multiFactorCode": "123456",
"newPassword": "string",
"oldPassword": "string",
"passkeyCredential": {
"challengeId": "6a1f0b1e-7d0c-4a43-9c1f-4f6c9b0f7a11",
"credential": {
"authenticatorAttachment": "platform",
"clientExtensionResults": {},
"id": "AN29uP9UVfVZ1X0WLKg3zA",
"rawId": "AN29uP9UVfVZ1X0WLKg3zA",
"response": {
"authenticatorData": "8q2Xwa9qKcqUca3Qox8O-H9rqwjlNp1O5WHPOETZnigdAAAAAA",
"clientDataJSON": "eyJ0eXBlIjoid2ViYXV0aG4uZ2V0IiwiY2hhbGxlbmdlIjoicmNVYTE2MzRZVWFDc0JlYXNyb1RWdWRCYjRqTlNuS3pUR3pKOUVkTGxyQSIsIm9yaWdpbiI6Imh0dHBzOi8vc3R1ZGlvLm1pdHR3YWxkLmRlIiwiY3Jvc3NPcmlnaW4iOmZhbHNlfQ",
"signature": "MEUCIQD7nQ352E7fNAwHcgq5mMDsoeHQ0odAgekdw9tbs-Lc1gIgSBt2yLdJV_AcNx76CMsEP-S7LoJ_E0q-y19EAEWtwLI",
"userHandle": "NmMxYzFkMGUtNmYwZS00YTNjLTlkM2YtNWYyZDFkMGI5YTEx"
},
"type": "public-key"
}
}
}
});
assertStatus(response, 200);
use \Mittwald\ApiClient\Generated\V2\Clients\User\ChangePassword\ChangePasswordRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\User\ChangePassword\ChangePasswordRequestBody;
$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));
// TODO: Please consult the properties and constructor signature of
// ChangePasswordRequestBody to learn how to construct a valid instance
$body = new ChangePasswordRequestBody(/* TODO: ... */);
$request = (new ChangePasswordRequest(
body: $body
));
$response = $client->user()->changePassword($request);
var_dump($response->getBody();