Skip to content

Commit 58697ac

Browse files
authored
Merge wied03/ENG-2158/change-password (#144)
* add new overload case * fix comment capitalization
1 parent 87789b6 commit 58697ac

3 files changed

Lines changed: 57 additions & 7 deletions

File tree

fusionauth-netcore-client/src/io/fusionauth/FusionAuthClient.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,17 @@ public Task<ClientResponse<RESTVoid>> CheckChangePasswordUsingJWTAsync(string en
205205
public Task<ClientResponse<RESTVoid>> CheckChangePasswordUsingLoginIdAsync(string loginId) {
206206
return buildClient()
207207
.withUri("/api/user/change-password")
208-
.withParameter("username", loginId)
208+
.withParameter("loginId", loginId)
209+
.withMethod("Get")
210+
.goAsync<RESTVoid>();
211+
}
212+
213+
/// <inheritdoc/>
214+
public Task<ClientResponse<RESTVoid>> CheckChangePasswordUsingLoginIdAndLoginIdTypesAsync(string loginId, List<string> loginIdTypes) {
215+
return buildClient()
216+
.withUri("/api/user/change-password")
217+
.withParameter("loginId", loginId)
218+
.withParameter("loginIdTypes", loginIdTypes)
209219
.withMethod("Get")
210220
.goAsync<RESTVoid>();
211221
}

fusionauth-netcore-client/src/io/fusionauth/FusionAuthSyncClient.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ public ClientResponse<RESTVoid> CheckChangePasswordUsingLoginId(string loginId)
117117
return client.CheckChangePasswordUsingLoginIdAsync(loginId).GetAwaiter().GetResult();
118118
}
119119

120+
/// <inheritdoc/>
121+
public ClientResponse<RESTVoid> CheckChangePasswordUsingLoginIdAndLoginIdTypes(string loginId, List<string> loginIdTypes) {
122+
return client.CheckChangePasswordUsingLoginIdAndLoginIdTypesAsync(loginId, loginIdTypes).GetAwaiter().GetResult();
123+
}
124+
120125
/// <inheritdoc/>
121126
public ClientResponse<AccessToken> ClientCredentialsGrant(string client_id, string client_secret, string scope) {
122127
return client.ClientCredentialsGrantAsync(client_id, client_secret, scope).GetAwaiter().GetResult();

fusionauth-netcore-client/src/io/fusionauth/IFusionAuthClient.cs

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public interface IFusionAuthAsyncClient {
216216
/// 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.
217217
/// This is an asynchronous method.
218218
/// </summary>
219-
/// <param name="loginId"> The loginId of the User that you intend to change the password for.</param>
219+
/// <param name="loginId"> The loginId (email or username) of the User that you intend to change the password for.</param>
220220
/// <returns>
221221
/// When successful, the response will contain the log of the action. If there was a validation error or any
222222
/// other type of error, this will return the Errors object in the response. Additionally, if FusionAuth could not be
@@ -225,6 +225,24 @@ public interface IFusionAuthAsyncClient {
225225
/// </returns>
226226
Task<ClientResponse<RESTVoid>> CheckChangePasswordUsingLoginIdAsync(string loginId);
227227

228+
/// <summary>
229+
/// Check to see if the user must obtain a Trust Request Id in order to complete a change password request.
230+
/// When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change
231+
/// your password, you must obtain a Trust Request Id by completing a Two-Factor Step-Up authentication.
232+
///
233+
/// 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.
234+
/// This is an asynchronous method.
235+
/// </summary>
236+
/// <param name="loginId"> The loginId of the User that you intend to change the password for.</param>
237+
/// <param name="loginIdTypes"> The identity types that FusionAuth will compare the loginId to.</param>
238+
/// <returns>
239+
/// When successful, the response will contain the log of the action. If there was a validation error or any
240+
/// other type of error, this will return the Errors object in the response. Additionally, if FusionAuth could not be
241+
/// contacted because it is down or experiencing a failure, the response will contain an Exception, which could be an
242+
/// IOException.
243+
/// </returns>
244+
Task<ClientResponse<RESTVoid>> CheckChangePasswordUsingLoginIdAndLoginIdTypesAsync(string loginId, List<string> loginIdTypes);
245+
228246
/// <summary>
229247
/// Make a Client Credentials grant request to obtain an access token.
230248
/// This is an asynchronous method.
@@ -3510,7 +3528,7 @@ public interface IFusionAuthAsyncClient {
35103528
/// This is an asynchronous method.
35113529
/// </summary>
35123530
/// <param name="loginId"> The email or username of the user.</param>
3513-
/// <param name="loginIdTypes"> the identity types that FusionAuth will compare the loginId to.</param>
3531+
/// <param name="loginIdTypes"> The identity types that FusionAuth will compare the loginId to.</param>
35143532
/// <returns>
35153533
/// When successful, the response will contain the log of the action. If there was a validation error or any
35163534
/// other type of error, this will return the Errors object in the response. Additionally, if FusionAuth could not be
@@ -3704,7 +3722,7 @@ public interface IFusionAuthAsyncClient {
37043722
/// <param name="loginId"> The userId id.</param>
37053723
/// <param name="start"> The start instant as UTC milliseconds since Epoch.</param>
37063724
/// <param name="end"> The end instant as UTC milliseconds since Epoch.</param>
3707-
/// <param name="loginIdTypes"> the identity types that FusionAuth will compare the loginId to.</param>
3725+
/// <param name="loginIdTypes"> The identity types that FusionAuth will compare the loginId to.</param>
37083726
/// <returns>
37093727
/// When successful, the response will contain the log of the action. If there was a validation error or any
37103728
/// other type of error, this will return the Errors object in the response. Additionally, if FusionAuth could not be
@@ -5263,7 +5281,7 @@ public interface IFusionAuthSyncClient {
52635281
///
52645282
/// 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.
52655283
/// </summary>
5266-
/// <param name="loginId"> The loginId of the User that you intend to change the password for.</param>
5284+
/// <param name="loginId"> The loginId (email or username) of the User that you intend to change the password for.</param>
52675285
/// <returns>
52685286
/// When successful, the response will contain the log of the action. If there was a validation error or any
52695287
/// other type of error, this will return the Errors object in the response. Additionally, if FusionAuth could not be
@@ -5272,6 +5290,23 @@ public interface IFusionAuthSyncClient {
52725290
/// </returns>
52735291
ClientResponse<RESTVoid> CheckChangePasswordUsingLoginId(string loginId);
52745292

5293+
/// <summary>
5294+
/// Check to see if the user must obtain a Trust Request Id in order to complete a change password request.
5295+
/// When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change
5296+
/// your password, you must obtain a Trust Request Id by completing a Two-Factor Step-Up authentication.
5297+
///
5298+
/// 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.
5299+
/// </summary>
5300+
/// <param name="loginId"> The loginId of the User that you intend to change the password for.</param>
5301+
/// <param name="loginIdTypes"> The identity types that FusionAuth will compare the loginId to.</param>
5302+
/// <returns>
5303+
/// When successful, the response will contain the log of the action. If there was a validation error or any
5304+
/// other type of error, this will return the Errors object in the response. Additionally, if FusionAuth could not be
5305+
/// contacted because it is down or experiencing a failure, the response will contain an Exception, which could be an
5306+
/// IOException.
5307+
/// </returns>
5308+
ClientResponse<RESTVoid> CheckChangePasswordUsingLoginIdAndLoginIdTypes(string loginId, List<string> loginIdTypes);
5309+
52755310
/// <summary>
52765311
/// Make a Client Credentials grant request to obtain an access token.
52775312
/// </summary>
@@ -8320,7 +8355,7 @@ public interface IFusionAuthSyncClient {
83208355
/// Retrieves the user for the loginId, using specific loginIdTypes.
83218356
/// </summary>
83228357
/// <param name="loginId"> The email or username of the user.</param>
8323-
/// <param name="loginIdTypes"> the identity types that FusionAuth will compare the loginId to.</param>
8358+
/// <param name="loginIdTypes"> The identity types that FusionAuth will compare the loginId to.</param>
83248359
/// <returns>
83258360
/// When successful, the response will contain the log of the action. If there was a validation error or any
83268361
/// other type of error, this will return the Errors object in the response. Additionally, if FusionAuth could not be
@@ -8501,7 +8536,7 @@ public interface IFusionAuthSyncClient {
85018536
/// <param name="loginId"> The userId id.</param>
85028537
/// <param name="start"> The start instant as UTC milliseconds since Epoch.</param>
85038538
/// <param name="end"> The end instant as UTC milliseconds since Epoch.</param>
8504-
/// <param name="loginIdTypes"> the identity types that FusionAuth will compare the loginId to.</param>
8539+
/// <param name="loginIdTypes"> The identity types that FusionAuth will compare the loginId to.</param>
85058540
/// <returns>
85068541
/// When successful, the response will contain the log of the action. If there was a validation error or any
85078542
/// other type of error, this will return the Errors object in the response. Additionally, if FusionAuth could not be

0 commit comments

Comments
 (0)