cidaas-javascript-sdk 3.0.4 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -2
- package/README.md +6 -2
- package/package.json +19 -8
- package/src/main/authentication/index.ts +1 -1
- package/src/main/web-auth/ConsentService.ts +7 -29
- package/src/main/web-auth/Entities.ts +0 -43
- package/src/main/web-auth/Helper.ts +4 -4
- package/src/main/web-auth/TokenService.ts +31 -120
- package/src/main/web-auth/UserService.ts +23 -158
- package/src/main/web-auth/VerificationService.ts +16 -36
- package/src/main/web-auth/WebAuth.ts +48 -241
- package/types/main/authentication/index.js +1 -1
- package/types/main/web-auth/ConsentService.js +7 -31
- package/types/main/web-auth/Entities.d.ts +68 -109
- package/types/main/web-auth/Entities.js +1 -13
- package/types/main/web-auth/Helper.d.ts +3 -3
- package/types/main/web-auth/Helper.js +4 -4
- package/types/main/web-auth/LoginService.d.ts +5 -4
- package/types/main/web-auth/LoginService.js +1 -1
- package/types/main/web-auth/TokenService.js +31 -127
- package/types/main/web-auth/UserService.d.ts +3 -3
- package/types/main/web-auth/UserService.js +38 -135
- package/types/main/web-auth/VerificationService.js +16 -38
- package/types/main/web-auth/WebAuth.d.ts +8 -17
- package/types/main/web-auth/WebAuth.js +62 -273
|
@@ -10,30 +10,11 @@ var UserService;
|
|
|
10
10
|
* @returns
|
|
11
11
|
*/
|
|
12
12
|
function getUserProfile(options) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var http = new XMLHttpRequest();
|
|
19
|
-
var _serviceURL = window.webAuthSettings.authority + "/users-srv/userinfo";
|
|
20
|
-
http.onreadystatechange = function () {
|
|
21
|
-
if (http.readyState == 4) {
|
|
22
|
-
resolve(JSON.parse(http.responseText));
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
http.open("GET", _serviceURL, true);
|
|
26
|
-
http.setRequestHeader("Content-type", "application/json");
|
|
27
|
-
http.setRequestHeader("Authorization", "Bearer ".concat(options.access_token));
|
|
28
|
-
if (window.localeSettings) {
|
|
29
|
-
http.setRequestHeader("accept-language", window.localeSettings);
|
|
30
|
-
}
|
|
31
|
-
http.send();
|
|
32
|
-
}
|
|
33
|
-
catch (ex) {
|
|
34
|
-
reject(ex);
|
|
35
|
-
}
|
|
36
|
-
});
|
|
13
|
+
if (!options.access_token) {
|
|
14
|
+
throw new Helper_1.CustomException("access_token cannot be empty", 417);
|
|
15
|
+
}
|
|
16
|
+
var _serviceURL = window.webAuthSettings.authority + "/users-srv/userinfo";
|
|
17
|
+
return Helper_1.Helper.createPostPromise(undefined, _serviceURL, undefined, "GET", options.access_token);
|
|
37
18
|
}
|
|
38
19
|
UserService.getUserProfile = getUserProfile;
|
|
39
20
|
;
|
|
@@ -94,31 +75,8 @@ var UserService;
|
|
|
94
75
|
* @returns
|
|
95
76
|
*/
|
|
96
77
|
function getInviteUserDetails(options) {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
var http = new XMLHttpRequest();
|
|
100
|
-
var _serviceURL = window.webAuthSettings.authority + "/users-srv/invite/info/" + options.invite_id;
|
|
101
|
-
http.onreadystatechange = function () {
|
|
102
|
-
if (http.readyState == 4) {
|
|
103
|
-
if (http.responseText) {
|
|
104
|
-
resolve(JSON.parse(http.responseText));
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
resolve(false);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
http.open("GET", _serviceURL, true);
|
|
112
|
-
http.setRequestHeader("Content-type", "application/json");
|
|
113
|
-
if (window.localeSettings) {
|
|
114
|
-
http.setRequestHeader("accept-language", window.localeSettings);
|
|
115
|
-
}
|
|
116
|
-
http.send();
|
|
117
|
-
}
|
|
118
|
-
catch (ex) {
|
|
119
|
-
reject(ex);
|
|
120
|
-
}
|
|
121
|
-
});
|
|
78
|
+
var _serviceURL = window.webAuthSettings.authority + "/users-srv/invite/info/" + options.invite_id;
|
|
79
|
+
return Helper_1.Helper.createPostPromise(undefined, _serviceURL, false, "GET");
|
|
122
80
|
}
|
|
123
81
|
UserService.getInviteUserDetails = getInviteUserDetails;
|
|
124
82
|
;
|
|
@@ -166,7 +124,7 @@ var UserService;
|
|
|
166
124
|
*/
|
|
167
125
|
function initiateResetPassword(options) {
|
|
168
126
|
var _serviceURL = window.webAuthSettings.authority + "/users-srv/resetpassword/initiate";
|
|
169
|
-
return Helper_1.Helper.createPostPromise(options, _serviceURL, false);
|
|
127
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "POST");
|
|
170
128
|
}
|
|
171
129
|
UserService.initiateResetPassword = initiateResetPassword;
|
|
172
130
|
;
|
|
@@ -177,9 +135,14 @@ var UserService;
|
|
|
177
135
|
function handleResetPassword(options) {
|
|
178
136
|
try {
|
|
179
137
|
var url = window.webAuthSettings.authority + "/users-srv/resetpassword/validatecode";
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
138
|
+
if (window.webAuthSettings.cidaas_version > 2) {
|
|
139
|
+
var form = Helper_1.Helper.createForm(url, options);
|
|
140
|
+
document.body.appendChild(form);
|
|
141
|
+
form.submit();
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
return Helper_1.Helper.createPostPromise(options, url, false, "POST");
|
|
145
|
+
}
|
|
183
146
|
}
|
|
184
147
|
catch (ex) {
|
|
185
148
|
throw new Helper_1.CustomException(ex, 417);
|
|
@@ -192,11 +155,16 @@ var UserService;
|
|
|
192
155
|
* @param options
|
|
193
156
|
*/
|
|
194
157
|
function resetPassword(options) {
|
|
158
|
+
var url = window.webAuthSettings.authority + "/users-srv/resetpassword/accept";
|
|
195
159
|
try {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
160
|
+
if (window.webAuthSettings.cidaas_version > 2) {
|
|
161
|
+
var form = Helper_1.Helper.createForm(url, options);
|
|
162
|
+
document.body.appendChild(form);
|
|
163
|
+
form.submit();
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
return Helper_1.Helper.createPostPromise(options, url, false, "POST");
|
|
167
|
+
}
|
|
200
168
|
}
|
|
201
169
|
catch (ex) {
|
|
202
170
|
throw new Helper_1.CustomException(ex, 417);
|
|
@@ -210,31 +178,8 @@ var UserService;
|
|
|
210
178
|
* @returns
|
|
211
179
|
*/
|
|
212
180
|
function getDeduplicationDetails(options) {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
var http = new XMLHttpRequest();
|
|
216
|
-
var _serviceURL = window.webAuthSettings.authority + "/users-srv/deduplication/info/" + options.trackId;
|
|
217
|
-
http.onreadystatechange = function () {
|
|
218
|
-
if (http.readyState == 4) {
|
|
219
|
-
if (http.responseText) {
|
|
220
|
-
resolve(JSON.parse(http.responseText));
|
|
221
|
-
}
|
|
222
|
-
else {
|
|
223
|
-
resolve(false);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
};
|
|
227
|
-
http.open("GET", _serviceURL, true);
|
|
228
|
-
http.setRequestHeader("Content-type", "application/json");
|
|
229
|
-
if (window.localeSettings) {
|
|
230
|
-
http.setRequestHeader("accept-language", window.localeSettings);
|
|
231
|
-
}
|
|
232
|
-
http.send();
|
|
233
|
-
}
|
|
234
|
-
catch (ex) {
|
|
235
|
-
reject(ex);
|
|
236
|
-
}
|
|
237
|
-
});
|
|
181
|
+
var _serviceURL = window.webAuthSettings.authority + "/users-srv/deduplication/info/" + options.trackId;
|
|
182
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "GET", undefined);
|
|
238
183
|
}
|
|
239
184
|
UserService.getDeduplicationDetails = getDeduplicationDetails;
|
|
240
185
|
;
|
|
@@ -262,26 +207,8 @@ var UserService;
|
|
|
262
207
|
* @returns
|
|
263
208
|
*/
|
|
264
209
|
function registerDeduplication(options) {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
var http = new XMLHttpRequest();
|
|
268
|
-
var _serviceURL = window.webAuthSettings.authority + "/users-srv/deduplication/register/" + options.trackId;
|
|
269
|
-
http.onreadystatechange = function () {
|
|
270
|
-
if (http.readyState == 4) {
|
|
271
|
-
resolve(JSON.parse(http.responseText));
|
|
272
|
-
}
|
|
273
|
-
};
|
|
274
|
-
http.open("POST", _serviceURL, true);
|
|
275
|
-
http.setRequestHeader("Content-type", "application/json");
|
|
276
|
-
if (window.localeSettings) {
|
|
277
|
-
http.setRequestHeader("accept-language", window.localeSettings);
|
|
278
|
-
}
|
|
279
|
-
http.send();
|
|
280
|
-
}
|
|
281
|
-
catch (ex) {
|
|
282
|
-
reject(ex);
|
|
283
|
-
}
|
|
284
|
-
});
|
|
210
|
+
var _serviceURL = window.webAuthSettings.authority + "/users-srv/deduplication/register/" + options.trackId;
|
|
211
|
+
return Helper_1.Helper.createPostPromise(undefined, _serviceURL, undefined, "POST");
|
|
285
212
|
}
|
|
286
213
|
UserService.registerDeduplication = registerDeduplication;
|
|
287
214
|
;
|
|
@@ -293,7 +220,7 @@ var UserService;
|
|
|
293
220
|
*/
|
|
294
221
|
function changePassword(options, access_token) {
|
|
295
222
|
var _serviceURL = window.webAuthSettings.authority + "/users-srv/changepassword";
|
|
296
|
-
return Helper_1.Helper.createPostPromise(options, _serviceURL, false, access_token);
|
|
223
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "POST", access_token);
|
|
297
224
|
}
|
|
298
225
|
UserService.changePassword = changePassword;
|
|
299
226
|
;
|
|
@@ -305,32 +232,8 @@ var UserService;
|
|
|
305
232
|
* @returns
|
|
306
233
|
*/
|
|
307
234
|
function updateProfile(options, access_token, sub) {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
var http = new XMLHttpRequest();
|
|
311
|
-
var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/profile/" + sub;
|
|
312
|
-
http.onreadystatechange = function () {
|
|
313
|
-
if (http.readyState == 4) {
|
|
314
|
-
if (http.responseText) {
|
|
315
|
-
resolve(JSON.parse(http.responseText));
|
|
316
|
-
}
|
|
317
|
-
else {
|
|
318
|
-
resolve(false);
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
};
|
|
322
|
-
http.open("PUT", _serviceURL, true);
|
|
323
|
-
http.setRequestHeader("Content-type", "application/json");
|
|
324
|
-
http.setRequestHeader("Authorization", "Bearer ".concat(access_token));
|
|
325
|
-
if (window.localeSettings) {
|
|
326
|
-
http.setRequestHeader("accept-language", window.localeSettings);
|
|
327
|
-
}
|
|
328
|
-
http.send(JSON.stringify(options));
|
|
329
|
-
}
|
|
330
|
-
catch (ex) {
|
|
331
|
-
throw new Helper_1.CustomException(ex, 417);
|
|
332
|
-
}
|
|
333
|
-
});
|
|
235
|
+
var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/profile/" + sub;
|
|
236
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "PUT", access_token);
|
|
334
237
|
}
|
|
335
238
|
UserService.updateProfile = updateProfile;
|
|
336
239
|
;
|
|
@@ -343,7 +246,7 @@ var UserService;
|
|
|
343
246
|
function initiateLinkAccount(options, access_token) {
|
|
344
247
|
options.user_name_type = 'email';
|
|
345
248
|
var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/link/initiate";
|
|
346
|
-
return Helper_1.Helper.createPostPromise(options, _serviceURL, false, access_token);
|
|
249
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "POST", access_token);
|
|
347
250
|
}
|
|
348
251
|
UserService.initiateLinkAccount = initiateLinkAccount;
|
|
349
252
|
;
|
|
@@ -355,7 +258,7 @@ var UserService;
|
|
|
355
258
|
*/
|
|
356
259
|
function completeLinkAccount(options, access_token) {
|
|
357
260
|
var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/link/complete";
|
|
358
|
-
return Helper_1.Helper.createPostPromise(options, _serviceURL, false, access_token);
|
|
261
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "POST", access_token);
|
|
359
262
|
}
|
|
360
263
|
UserService.completeLinkAccount = completeLinkAccount;
|
|
361
264
|
;
|
|
@@ -367,7 +270,7 @@ var UserService;
|
|
|
367
270
|
*/
|
|
368
271
|
function getLinkedUsers(access_token, sub) {
|
|
369
272
|
var _serviceURL = window.webAuthSettings.authority + "/users-srv/userinfo/social/" + sub;
|
|
370
|
-
return Helper_1.Helper.createPostPromise(undefined, _serviceURL, false, access_token);
|
|
273
|
+
return Helper_1.Helper.createPostPromise(undefined, _serviceURL, false, "POST", access_token);
|
|
371
274
|
}
|
|
372
275
|
UserService.getLinkedUsers = getLinkedUsers;
|
|
373
276
|
;
|
|
@@ -379,7 +282,7 @@ var UserService;
|
|
|
379
282
|
*/
|
|
380
283
|
function unlinkAccount(access_token, identityId) {
|
|
381
284
|
var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/unlink/" + identityId;
|
|
382
|
-
return Helper_1.Helper.createPostPromise(undefined, _serviceURL, false, access_token);
|
|
285
|
+
return Helper_1.Helper.createPostPromise(undefined, _serviceURL, false, "POST", access_token);
|
|
383
286
|
}
|
|
384
287
|
UserService.unlinkAccount = unlinkAccount;
|
|
385
288
|
;
|
|
@@ -390,7 +293,7 @@ var UserService;
|
|
|
390
293
|
*/
|
|
391
294
|
function deleteUserAccount(options) {
|
|
392
295
|
var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/unregister/scheduler/schedule/" + options.sub;
|
|
393
|
-
return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined, options.access_token);
|
|
296
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined, "POST", options.access_token);
|
|
394
297
|
}
|
|
395
298
|
UserService.deleteUserAccount = deleteUserAccount;
|
|
396
299
|
;
|
|
@@ -401,7 +304,7 @@ var UserService;
|
|
|
401
304
|
*/
|
|
402
305
|
function userCheckExists(options) {
|
|
403
306
|
var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/checkexists/" + options.requestId;
|
|
404
|
-
return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined);
|
|
307
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined, "POST");
|
|
405
308
|
}
|
|
406
309
|
UserService.userCheckExists = userCheckExists;
|
|
407
310
|
;
|
|
@@ -53,7 +53,7 @@ var VerificationService;
|
|
|
53
53
|
*/
|
|
54
54
|
function verifyAccount(options) {
|
|
55
55
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/account/verify";
|
|
56
|
-
return Helper_1.Helper.createPostPromise(options, _serviceURL, false);
|
|
56
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "POST");
|
|
57
57
|
}
|
|
58
58
|
VerificationService.verifyAccount = verifyAccount;
|
|
59
59
|
;
|
|
@@ -64,7 +64,7 @@ var VerificationService;
|
|
|
64
64
|
*/
|
|
65
65
|
function getMFAListV2(options) {
|
|
66
66
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/public/configured/list";
|
|
67
|
-
return Helper_1.Helper.createPostPromise(options, _serviceURL, false);
|
|
67
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "POST");
|
|
68
68
|
}
|
|
69
69
|
VerificationService.getMFAListV2 = getMFAListV2;
|
|
70
70
|
;
|
|
@@ -75,7 +75,7 @@ var VerificationService;
|
|
|
75
75
|
*/
|
|
76
76
|
function cancelMFAV2(options) {
|
|
77
77
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/cancel/" + options.type;
|
|
78
|
-
return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined);
|
|
78
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined, "POST");
|
|
79
79
|
}
|
|
80
80
|
VerificationService.cancelMFAV2 = cancelMFAV2;
|
|
81
81
|
;
|
|
@@ -84,30 +84,8 @@ var VerificationService;
|
|
|
84
84
|
* @returns
|
|
85
85
|
*/
|
|
86
86
|
function getAllVerificationList(access_token) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
var http = new XMLHttpRequest();
|
|
90
|
-
http.onreadystatechange = function () {
|
|
91
|
-
if (http.readyState == 4) {
|
|
92
|
-
if (http.responseText) {
|
|
93
|
-
resolve(JSON.parse(http.responseText));
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
resolve(undefined);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
http.open("GET", "".concat(window.webAuthSettings.authority, "/verification-srv/config/list"), true);
|
|
101
|
-
http.setRequestHeader("Authorization", "Bearer ".concat(access_token));
|
|
102
|
-
if (window.localeSettings) {
|
|
103
|
-
http.setRequestHeader("accept-language", window.localeSettings);
|
|
104
|
-
}
|
|
105
|
-
http.send();
|
|
106
|
-
}
|
|
107
|
-
catch (ex) {
|
|
108
|
-
reject(ex);
|
|
109
|
-
}
|
|
110
|
-
});
|
|
87
|
+
var _serviceURL = "".concat(window.webAuthSettings.authority, "/verification-srv/config/list");
|
|
88
|
+
return Helper_1.Helper.createPostPromise(undefined, _serviceURL, undefined, "GET", access_token);
|
|
111
89
|
}
|
|
112
90
|
VerificationService.getAllVerificationList = getAllVerificationList;
|
|
113
91
|
;
|
|
@@ -118,7 +96,7 @@ var VerificationService;
|
|
|
118
96
|
*/
|
|
119
97
|
function enrollVerification(options) {
|
|
120
98
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/enroll/" + options.verification_type;
|
|
121
|
-
return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined);
|
|
99
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined, "POST");
|
|
122
100
|
}
|
|
123
101
|
VerificationService.enrollVerification = enrollVerification;
|
|
124
102
|
;
|
|
@@ -129,7 +107,7 @@ var VerificationService;
|
|
|
129
107
|
*/
|
|
130
108
|
function updateSocket(status_id) {
|
|
131
109
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/notification/status/" + status_id;
|
|
132
|
-
return Helper_1.Helper.createPostPromise(undefined, _serviceURL, undefined);
|
|
110
|
+
return Helper_1.Helper.createPostPromise(undefined, _serviceURL, undefined, "POST");
|
|
133
111
|
}
|
|
134
112
|
VerificationService.updateSocket = updateSocket;
|
|
135
113
|
;
|
|
@@ -140,7 +118,7 @@ var VerificationService;
|
|
|
140
118
|
*/
|
|
141
119
|
function updateStatus(status_id) {
|
|
142
120
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/notification/status/" + status_id;
|
|
143
|
-
return Helper_1.Helper.createPostPromise(undefined, _serviceURL, undefined);
|
|
121
|
+
return Helper_1.Helper.createPostPromise(undefined, _serviceURL, undefined, "POST");
|
|
144
122
|
}
|
|
145
123
|
VerificationService.updateStatus = updateStatus;
|
|
146
124
|
;
|
|
@@ -151,7 +129,7 @@ var VerificationService;
|
|
|
151
129
|
*/
|
|
152
130
|
function setupFidoVerification(options) {
|
|
153
131
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/initiate/suggestmfa/" + options.verification_type;
|
|
154
|
-
return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined);
|
|
132
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined, "POST");
|
|
155
133
|
}
|
|
156
134
|
VerificationService.setupFidoVerification = setupFidoVerification;
|
|
157
135
|
;
|
|
@@ -162,7 +140,7 @@ var VerificationService;
|
|
|
162
140
|
*/
|
|
163
141
|
function checkVerificationTypeConfigured(options) {
|
|
164
142
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/public/configured/check/" + options.verification_type;
|
|
165
|
-
return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined);
|
|
143
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined, "POST");
|
|
166
144
|
}
|
|
167
145
|
VerificationService.checkVerificationTypeConfigured = checkVerificationTypeConfigured;
|
|
168
146
|
;
|
|
@@ -173,7 +151,7 @@ var VerificationService;
|
|
|
173
151
|
*/
|
|
174
152
|
function initiateMFAV2(options) {
|
|
175
153
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/authenticate/initiate/" + options.type;
|
|
176
|
-
return Helper_1.Helper.createPostPromise(options, _serviceURL, false);
|
|
154
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "POST");
|
|
177
155
|
}
|
|
178
156
|
VerificationService.initiateMFAV2 = initiateMFAV2;
|
|
179
157
|
;
|
|
@@ -185,7 +163,7 @@ var VerificationService;
|
|
|
185
163
|
*/
|
|
186
164
|
function initiateMfaV1(options, verificationType) {
|
|
187
165
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/" + verificationType.toLowerCase() + "/initiate";
|
|
188
|
-
return Helper_1.Helper.createPostPromise(options, _serviceURL, false);
|
|
166
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "POST");
|
|
189
167
|
}
|
|
190
168
|
VerificationService.initiateMfaV1 = initiateMfaV1;
|
|
191
169
|
/**
|
|
@@ -195,7 +173,7 @@ var VerificationService;
|
|
|
195
173
|
*/
|
|
196
174
|
function authenticateMFAV2(options) {
|
|
197
175
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/authenticate/authenticate/" + options.type;
|
|
198
|
-
return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined);
|
|
176
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined, "POST");
|
|
199
177
|
}
|
|
200
178
|
VerificationService.authenticateMFAV2 = authenticateMFAV2;
|
|
201
179
|
;
|
|
@@ -243,7 +221,7 @@ var VerificationService;
|
|
|
243
221
|
*/
|
|
244
222
|
function setupVerificationV1(options, access_token, verificationType) {
|
|
245
223
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/" + verificationType.toLowerCase() + "/setup";
|
|
246
|
-
return Helper_1.Helper.createPostPromise(options, _serviceURL, false, access_token);
|
|
224
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "POST", access_token);
|
|
247
225
|
}
|
|
248
226
|
VerificationService.setupVerificationV1 = setupVerificationV1;
|
|
249
227
|
/**
|
|
@@ -256,7 +234,7 @@ var VerificationService;
|
|
|
256
234
|
*/
|
|
257
235
|
function enrollVerificationV1(options, access_token, verificationType) {
|
|
258
236
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/" + verificationType.toLowerCase() + "/enroll";
|
|
259
|
-
return Helper_1.Helper.createPostPromise(options, _serviceURL, false, access_token);
|
|
237
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "POST", access_token);
|
|
260
238
|
}
|
|
261
239
|
VerificationService.enrollVerificationV1 = enrollVerificationV1;
|
|
262
240
|
/**
|
|
@@ -267,7 +245,7 @@ var VerificationService;
|
|
|
267
245
|
*/
|
|
268
246
|
function authenticateMfaV1(options, verificationType) {
|
|
269
247
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/" + verificationType.toLowerCase() + "/authenticate";
|
|
270
|
-
return Helper_1.Helper.createPostPromise(options, _serviceURL, false);
|
|
248
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "POST");
|
|
271
249
|
}
|
|
272
250
|
VerificationService.authenticateMfaV1 = authenticateMfaV1;
|
|
273
251
|
})(VerificationService = exports.VerificationService || (exports.VerificationService = {}));
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
import { UserManagerSettings } from "oidc-client-ts";
|
|
2
2
|
import { AccessTokenRequest, TokenIntrospectionEntity, UserEntity, ResetPasswordEntity, IConfiguredListRequestEntity, IInitVerificationAuthenticationRequestEntity, FindUserEntity, IUserEntity, FidoSetupEntity, IEnrollVerificationSetupRequestEntity, ISuggestedMFAActionConfig, IUserLinkEntity, UpdateReviewDeviceEntity, UserActivityEntity, ChangePasswordEntity, IConsentAcceptEntity, IAuthVerificationAuthenticationRequestEntity, FaceVerificationAuthenticationRequestEntity, LoginFormRequestEntity, AccountVerificationRequestEntity, ValidateResetPasswordEntity, AcceptResetPasswordEntity, LoginFormRequestAsyncEntity, PhysicalVerificationLoginRequest, IChangePasswordEntity } from "./Entities";
|
|
3
3
|
export declare class WebAuth {
|
|
4
|
-
private code_verifier;
|
|
5
4
|
constructor(settings: UserManagerSettings & {
|
|
6
5
|
mode?: string;
|
|
6
|
+
cidaas_version: number;
|
|
7
7
|
});
|
|
8
|
-
/**
|
|
9
|
-
* generate code verifier
|
|
10
|
-
*/
|
|
11
|
-
private generateCodeVerifier;
|
|
12
|
-
/**
|
|
13
|
-
* @param code_verifier
|
|
14
|
-
* @returns
|
|
15
|
-
*/
|
|
16
|
-
private generateCodeChallenge;
|
|
17
8
|
/**
|
|
18
9
|
* @param string
|
|
19
10
|
* @returns
|
|
@@ -208,7 +199,7 @@ export declare class WebAuth {
|
|
|
208
199
|
captcha?: string;
|
|
209
200
|
acceptlanguage?: string;
|
|
210
201
|
bot_captcha_response?: string;
|
|
211
|
-
trackId
|
|
202
|
+
trackId?: string;
|
|
212
203
|
}): Promise<unknown>;
|
|
213
204
|
/**
|
|
214
205
|
* get invite info
|
|
@@ -258,12 +249,12 @@ export declare class WebAuth {
|
|
|
258
249
|
* handle reset password
|
|
259
250
|
* @param options
|
|
260
251
|
*/
|
|
261
|
-
handleResetPassword(options: ValidateResetPasswordEntity):
|
|
252
|
+
handleResetPassword(options: ValidateResetPasswordEntity): Promise<unknown>;
|
|
262
253
|
/**
|
|
263
254
|
* reset password
|
|
264
255
|
* @param options
|
|
265
256
|
*/
|
|
266
|
-
resetPassword(options: AcceptResetPasswordEntity):
|
|
257
|
+
resetPassword(options: AcceptResetPasswordEntity): Promise<unknown>;
|
|
267
258
|
/**
|
|
268
259
|
* get mfa list v2
|
|
269
260
|
* @param options
|
|
@@ -882,14 +873,14 @@ export declare class WebAuth {
|
|
|
882
873
|
authenticateIVR(options: any): void;
|
|
883
874
|
/**
|
|
884
875
|
* @deprecated
|
|
885
|
-
* authenticate
|
|
876
|
+
* authenticate totp - v1
|
|
886
877
|
* @param options
|
|
887
878
|
*/
|
|
888
|
-
|
|
879
|
+
authenticateTOTP(options: any): void;
|
|
889
880
|
/**
|
|
890
881
|
* @deprecated
|
|
891
|
-
* authenticate
|
|
882
|
+
* authenticate backupcode - v1
|
|
892
883
|
* @param options
|
|
893
884
|
*/
|
|
894
|
-
|
|
885
|
+
authenticateBackupcode(options: any): void;
|
|
895
886
|
}
|