From 828927a6d26ff18200300f78ba5333d67c8ff82e Mon Sep 17 00:00:00 2001 From: Brady Wied Date: Fri, 12 Sep 2025 11:28:09 -0600 Subject: [PATCH 1/2] add new overload case --- src/FusionAuth/FusionAuthClient.php | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/FusionAuth/FusionAuthClient.php b/src/FusionAuth/FusionAuthClient.php index 657db36..dd9da1e 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(); } From 6d29b67cf5172c8edb6b988b47dbe1d912569b1b Mon Sep 17 00:00:00 2001 From: Brady Wied Date: Mon, 15 Sep 2025 15:20:12 -0600 Subject: [PATCH 2/2] fix comment capitalization --- src/FusionAuth/FusionAuthClient.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/FusionAuth/FusionAuthClient.php b/src/FusionAuth/FusionAuthClient.php index dd9da1e..9bd00c6 100644 --- a/src/FusionAuth/FusionAuthClient.php +++ b/src/FusionAuth/FusionAuthClient.php @@ -313,7 +313,7 @@ public function checkChangePasswordUsingLoginId($loginId) * 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. + * @param array $loginIdTypes The identity types that FusionAuth will compare the loginId to. * * @return ClientResponse The ClientResponse. * @throws \Exception @@ -4461,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 @@ -4712,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