Skip to content

Commit b2b4674

Browse files
committed
Client build
1 parent b07e8e5 commit b2b4674

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

src/FusionAuthClient.ts

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,60 @@ export class FusionAuthClient {
151151
.go();
152152
}
153153

154+
/**
155+
* Check to see if the user must obtain a Trust Token Id in order to complete a change password request.
156+
* When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change
157+
* your password, you must obtain a Truest Token by completing a Two-Factor Step-Up authentication.
158+
*
159+
* An HTTP status code of 412 indicates that a Trust Token is required to make a POST request to this API.
160+
*
161+
* @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.
162+
* @returns {Promise<ClientResponse<void>>}
163+
*/
164+
checkChangePasswordUsingId(changePasswordId: string): Promise<ClientResponse<void>> {
165+
return this.startAnonymous<void, Errors>()
166+
.withUri('/api/user/change-password')
167+
.withUriSegment(changePasswordId)
168+
.withMethod("GET")
169+
.go();
170+
}
171+
172+
/**
173+
* Check to see if the user must obtain a Trust Token Id in order to complete a change password request.
174+
* When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change
175+
* your password, you must obtain a Truest Token by completing a Two-Factor Step-Up authentication.
176+
*
177+
* An HTTP status code of 412 indicates that a Trust Token is required to make a POST request to this API.
178+
*
179+
* @param {string} encodedJWT The encoded JWT (access token).
180+
* @returns {Promise<ClientResponse<void>>}
181+
*/
182+
checkChangePasswordUsingJWT(encodedJWT: string): Promise<ClientResponse<void>> {
183+
return this.startAnonymous<void, Errors>()
184+
.withUri('/api/user/change-password')
185+
.withAuthorization('Bearer ' + encodedJWT)
186+
.withMethod("GET")
187+
.go();
188+
}
189+
190+
/**
191+
* Check to see if the user must obtain a Trust Request Id in order to complete a change password request.
192+
* When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change
193+
* your password, you must obtain a Truest Request Id by completing a Two-Factor Step-Up authentication.
194+
*
195+
* An HTTP status code of 412 indicates that a Trust Token is required to make a POST request to this API.
196+
*
197+
* @param {string} loginId The loginId of the User that you intend to change the password for.
198+
* @returns {Promise<ClientResponse<void>>}
199+
*/
200+
checkChangePasswordUsingLoginId(loginId: string): Promise<ClientResponse<void>> {
201+
return this.start<void, Errors>()
202+
.withUri('/api/user/change-password')
203+
.withParameter('username', loginId)
204+
.withMethod("GET")
205+
.go();
206+
}
207+
154208
/**
155209
* Adds a comment to the user's account.
156210
*
@@ -5353,6 +5407,8 @@ export interface ChangePasswordRequest extends BaseEventRequest {
53535407
loginId?: string;
53545408
password?: string;
53555409
refreshToken?: string;
5410+
trustChallenge?: string;
5411+
trustToken?: string;
53565412
}
53575413

53585414
/**
@@ -6167,6 +6223,7 @@ export interface ExternalIdentifierConfiguration {
61676223
samlv2AuthNRequestIdTimeToLiveInSeconds?: number;
61686224
setupPasswordIdGenerator?: SecureGeneratorConfiguration;
61696225
setupPasswordIdTimeToLiveInSeconds?: number;
6226+
trustTokenTimeToLiveInSeconds?: number;
61706227
twoFactorIdTimeToLiveInSeconds?: number;
61716228
twoFactorOneTimeCodeIdGenerator?: SecureGeneratorConfiguration;
61726229
twoFactorOneTimeCodeIdTimeToLiveInSeconds?: number;
@@ -7424,6 +7481,7 @@ export interface LoginResponse {
74247481
threatsDetected?: Array<AuthenticationThreats>;
74257482
token?: string;
74267483
tokenExpirationInstant?: number;
7484+
trustToken?: string;
74277485
twoFactorId?: string;
74287486
twoFactorTrustId?: string;
74297487
user?: User;
@@ -9042,6 +9100,7 @@ export interface TwoFactorStartRequest {
90429100
code?: string;
90439101
loginId?: string;
90449102
state?: Record<string, any>;
9103+
trustChallenge?: string;
90459104
userId?: UUID;
90469105
}
90479106

0 commit comments

Comments
 (0)