diff --git a/src/FusionAuth/FusionAuthClient.php b/src/FusionAuth/FusionAuthClient.php index 657db36..9bd00c6 100644 --- a/src/FusionAuth/FusionAuthClient.php +++ b/src/FusionAuth/FusionAuthClient.php @@ -292,7 +292,7 @@ public function checkChangePasswordUsingJWT($encodedJWT) * * An HTTP status code of 400 with a general error code of [TrustTokenRequired] indicates that a Trust Token is required to make a POST request to this API. * - * @param string $loginId The loginId of the User that you intend to change the password for. + * @param string $loginId The loginId (email or username) of the User that you intend to change the password for. * * @return ClientResponse The ClientResponse. * @throws \Exception @@ -300,7 +300,29 @@ public function checkChangePasswordUsingJWT($encodedJWT) public function checkChangePasswordUsingLoginId($loginId) { return $this->start()->uri("/api/user/change-password") - ->urlParameter("username", $loginId) + ->urlParameter("loginId", $loginId) + ->get() + ->go(); + } + + /** + * Check to see if the user must obtain a Trust Request Id in order to complete a change password request. + * When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change + * your password, you must obtain a Trust Request Id by completing a Two-Factor Step-Up authentication. + * + * An HTTP status code of 400 with a general error code of [TrustTokenRequired] indicates that a Trust Token is required to make a POST request to this API. + * + * @param string $loginId The loginId of the User that you intend to change the password for. + * @param array $loginIdTypes The identity types that FusionAuth will compare the loginId to. + * + * @return ClientResponse The ClientResponse. + * @throws \Exception + */ + public function checkChangePasswordUsingLoginIdAndLoginIdTypes($loginId, $loginIdTypes) + { + return $this->start()->uri("/api/user/change-password") + ->urlParameter("loginId", $loginId) + ->urlParameter("loginIdTypes", $loginIdTypes) ->get() ->go(); } @@ -4439,7 +4461,7 @@ public function retrieveUserByLoginId($loginId) * Retrieves the user for the loginId, using specific loginIdTypes. * * @param string $loginId The email or username of the user. - * @param array $loginIdTypes the identity types that FusionAuth will compare the loginId to. + * @param array $loginIdTypes The identity types that FusionAuth will compare the loginId to. * * @return ClientResponse The ClientResponse. * @throws \Exception @@ -4690,7 +4712,7 @@ public function retrieveUserLoginReportByLoginId($applicationId, $loginId, $star * @param string $loginId The userId id. * @param array $start The start instant as UTC milliseconds since Epoch. * @param array $end The end instant as UTC milliseconds since Epoch. - * @param array $loginIdTypes the identity types that FusionAuth will compare the loginId to. + * @param array $loginIdTypes The identity types that FusionAuth will compare the loginId to. * * @return ClientResponse The ClientResponse. * @throws \Exception