Skip to content

Commit 891d956

Browse files
authored
Merge wied03/ENG-3608/mfa-change-password (#67)
* add IP address client overload * forgot to update method names
1 parent ade92fe commit 891d956

1 file changed

Lines changed: 90 additions & 0 deletions

File tree

src/FusionAuth/FusionAuthClient.php

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,28 @@ public function checkChangePasswordUsingId($changePasswordId)
265265
->go();
266266
}
267267

268+
/**
269+
* Check to see if the user must obtain a Trust Token Id in order to complete a change password request.
270+
* When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change
271+
* your password, you must obtain a Trust Token by completing a Two-Factor Step-Up authentication.
272+
*
273+
* 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.
274+
*
275+
* @param string $changePasswordId The change password Id used to find the user. This value is generated by FusionAuth once the change password workflow has been initiated.
276+
* @param string $ipAddress (Optional) IP address of the user changing their password. This is used for MFA risk assessment.
277+
*
278+
* @return ClientResponse The ClientResponse.
279+
* @throws \Exception
280+
*/
281+
public function checkChangePasswordUsingIdAndIPAddress($changePasswordId, $ipAddress = NULL)
282+
{
283+
return $this->startAnonymous()->uri("/api/user/change-password")
284+
->urlSegment($changePasswordId)
285+
->urlParameter("ipAddress", $ipAddress)
286+
->get()
287+
->go();
288+
}
289+
268290
/**
269291
* Check to see if the user must obtain a Trust Token Id in order to complete a change password request.
270292
* When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change
@@ -285,6 +307,28 @@ public function checkChangePasswordUsingJWT($encodedJWT)
285307
->go();
286308
}
287309

310+
/**
311+
* Check to see if the user must obtain a Trust Token Id in order to complete a change password request.
312+
* When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change
313+
* your password, you must obtain a Trust Token by completing a Two-Factor Step-Up authentication.
314+
*
315+
* 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.
316+
*
317+
* @param string $encodedJWT The encoded JWT (access token).
318+
* @param string $ipAddress (Optional) IP address of the user changing their password. This is used for MFA risk assessment.
319+
*
320+
* @return ClientResponse The ClientResponse.
321+
* @throws \Exception
322+
*/
323+
public function checkChangePasswordUsingJWTAndIPAddress($encodedJWT, $ipAddress = NULL)
324+
{
325+
return $this->startAnonymous()->uri("/api/user/change-password")
326+
->authorization("Bearer " . $encodedJWT)
327+
->urlParameter("ipAddress", $ipAddress)
328+
->get()
329+
->go();
330+
}
331+
288332
/**
289333
* Check to see if the user must obtain a Trust Request Id in order to complete a change password request.
290334
* When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change
@@ -305,6 +349,28 @@ public function checkChangePasswordUsingLoginId($loginId)
305349
->go();
306350
}
307351

352+
/**
353+
* Check to see if the user must obtain a Trust Request Id in order to complete a change password request.
354+
* When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change
355+
* your password, you must obtain a Trust Request Id by completing a Two-Factor Step-Up authentication.
356+
*
357+
* 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.
358+
*
359+
* @param string $loginId The loginId (email or username) of the User that you intend to change the password for.
360+
* @param string $ipAddress (Optional) IP address of the user changing their password. This is used for MFA risk assessment.
361+
*
362+
* @return ClientResponse The ClientResponse.
363+
* @throws \Exception
364+
*/
365+
public function checkChangePasswordUsingLoginIdAndIPAddress($loginId, $ipAddress = NULL)
366+
{
367+
return $this->start()->uri("/api/user/change-password")
368+
->urlParameter("loginId", $loginId)
369+
->urlParameter("ipAddress", $ipAddress)
370+
->get()
371+
->go();
372+
}
373+
308374
/**
309375
* Check to see if the user must obtain a Trust Request Id in order to complete a change password request.
310376
* When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change
@@ -327,6 +393,30 @@ public function checkChangePasswordUsingLoginIdAndLoginIdTypes($loginId, $loginI
327393
->go();
328394
}
329395

396+
/**
397+
* Check to see if the user must obtain a Trust Request Id in order to complete a change password request.
398+
* When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change
399+
* your password, you must obtain a Trust Request Id by completing a Two-Factor Step-Up authentication.
400+
*
401+
* 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.
402+
*
403+
* @param string $loginId The loginId of the User that you intend to change the password for.
404+
* @param array $loginIdTypes The identity types that FusionAuth will compare the loginId to.
405+
* @param string $ipAddress (Optional) IP address of the user changing their password. This is used for MFA risk assessment.
406+
*
407+
* @return ClientResponse The ClientResponse.
408+
* @throws \Exception
409+
*/
410+
public function checkChangePasswordUsingLoginIdAndLoginIdTypesAndIPAddress($loginId, $loginIdTypes, $ipAddress = NULL)
411+
{
412+
return $this->start()->uri("/api/user/change-password")
413+
->urlParameter("loginId", $loginId)
414+
->urlParameter("loginIdTypes", $loginIdTypes)
415+
->urlParameter("ipAddress", $ipAddress)
416+
->get()
417+
->go();
418+
}
419+
330420
/**
331421
* Make a Client Credentials grant request to obtain an access token.
332422
*

0 commit comments

Comments
 (0)