cidaas-javascript-sdk 3.0.5 → 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 +1 -1
- package/package.json +19 -8
- 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 -126
- 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 +38 -214
- package/types/main/web-auth/ConsentService.js +7 -31
- package/types/main/web-auth/Entities.d.ts +0 -41
- package/types/main/web-auth/Helper.d.ts +3 -3
- package/types/main/web-auth/Helper.js +4 -4
- package/types/main/web-auth/TokenService.js +31 -134
- package/types/main/web-auth/UserService.js +25 -172
- package/types/main/web-auth/VerificationService.js +16 -38
- package/types/main/web-auth/WebAuth.d.ts +4 -4
- package/types/main/web-auth/WebAuth.js +48 -246
|
@@ -10,31 +10,13 @@ var TokenService;
|
|
|
10
10
|
* @returns
|
|
11
11
|
*/
|
|
12
12
|
function renewToken(options) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var http = new XMLHttpRequest();
|
|
21
|
-
var _serviceURL = window.webAuthSettings.authority + "/token-srv/token";
|
|
22
|
-
http.onreadystatechange = function () {
|
|
23
|
-
if (http.readyState == 4) {
|
|
24
|
-
resolve(JSON.parse(http.responseText));
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
http.open("POST", _serviceURL, true);
|
|
28
|
-
http.setRequestHeader("Content-type", "application/json");
|
|
29
|
-
if (window.localeSettings) {
|
|
30
|
-
http.setRequestHeader("accept-language", window.localeSettings);
|
|
31
|
-
}
|
|
32
|
-
http.send(JSON.stringify(options));
|
|
33
|
-
}
|
|
34
|
-
catch (ex) {
|
|
35
|
-
reject(ex);
|
|
36
|
-
}
|
|
37
|
-
});
|
|
13
|
+
if (!options.refresh_token) {
|
|
14
|
+
throw new Helper_1.CustomException("refresh_token cannot be empty", 417);
|
|
15
|
+
}
|
|
16
|
+
options.client_id = window.webAuthSettings.client_id;
|
|
17
|
+
options.grant_type = 'refresh_token';
|
|
18
|
+
var _serviceURL = window.webAuthSettings.authority + "/token-srv/token";
|
|
19
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined, "POST");
|
|
38
20
|
}
|
|
39
21
|
TokenService.renewToken = renewToken;
|
|
40
22
|
;
|
|
@@ -44,41 +26,20 @@ var TokenService;
|
|
|
44
26
|
* @returns
|
|
45
27
|
*/
|
|
46
28
|
function getAccessToken(options) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
var
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
};
|
|
62
|
-
http.open("POST", _serviceURL, true);
|
|
63
|
-
http.setRequestHeader("Content-type", "application/json");
|
|
64
|
-
if (window.localeSettings) {
|
|
65
|
-
http.setRequestHeader("accept-language", window.localeSettings);
|
|
66
|
-
}
|
|
67
|
-
if (!window.webAuthSettings.disablePKCE) {
|
|
68
|
-
window.usermanager._client.createSigninRequest(window.webAuthSettings).then(function (signInRequest) {
|
|
69
|
-
var _a;
|
|
70
|
-
options.code_verifier = (_a = signInRequest.state) === null || _a === void 0 ? void 0 : _a.code_verifier;
|
|
71
|
-
http.send(JSON.stringify(options));
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
http.send(JSON.stringify(options));
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
catch (ex) {
|
|
79
|
-
reject(ex);
|
|
80
|
-
}
|
|
81
|
-
});
|
|
29
|
+
if (!options.code) {
|
|
30
|
+
throw new Helper_1.CustomException("code cannot be empty", 417);
|
|
31
|
+
}
|
|
32
|
+
options.client_id = window.webAuthSettings.client_id;
|
|
33
|
+
options.redirect_uri = window.webAuthSettings.redirect_uri;
|
|
34
|
+
options.grant_type = "authorization_code";
|
|
35
|
+
if (!window.webAuthSettings.disablePKCE) {
|
|
36
|
+
window.usermanager._client.createSigninRequest(window.webAuthSettings).then(function (signInRequest) {
|
|
37
|
+
var _a;
|
|
38
|
+
options.code_verifier = (_a = signInRequest.state) === null || _a === void 0 ? void 0 : _a.code_verifier;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
var _serviceURL = window.webAuthSettings.authority + "/token-srv/token";
|
|
42
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined, "POST");
|
|
82
43
|
}
|
|
83
44
|
TokenService.getAccessToken = getAccessToken;
|
|
84
45
|
;
|
|
@@ -88,29 +49,11 @@ var TokenService;
|
|
|
88
49
|
* @returns
|
|
89
50
|
*/
|
|
90
51
|
function validateAccessToken(options) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
var http = new XMLHttpRequest();
|
|
97
|
-
var _serviceURL = window.webAuthSettings.authority + "/token-srv/introspect";
|
|
98
|
-
http.onreadystatechange = function () {
|
|
99
|
-
if (http.readyState == 4) {
|
|
100
|
-
resolve(JSON.parse(http.responseText));
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
http.open("POST", _serviceURL, true);
|
|
104
|
-
http.setRequestHeader("Content-type", "application/json");
|
|
105
|
-
if (window.localeSettings) {
|
|
106
|
-
http.setRequestHeader("accept-language", window.localeSettings);
|
|
107
|
-
}
|
|
108
|
-
http.send(JSON.stringify(options));
|
|
109
|
-
}
|
|
110
|
-
catch (ex) {
|
|
111
|
-
reject(ex);
|
|
112
|
-
}
|
|
113
|
-
});
|
|
52
|
+
if (!options.token || !options.token_type_hint) {
|
|
53
|
+
throw new Helper_1.CustomException("token or token_type_hint cannot be empty", 417);
|
|
54
|
+
}
|
|
55
|
+
var _serviceURL = window.webAuthSettings.authority + "/token-srv/introspect";
|
|
56
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "POST");
|
|
114
57
|
}
|
|
115
58
|
TokenService.validateAccessToken = validateAccessToken;
|
|
116
59
|
;
|
|
@@ -120,31 +63,8 @@ var TokenService;
|
|
|
120
63
|
* @returns
|
|
121
64
|
*/
|
|
122
65
|
function getScopeConsentDetails(options) {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
var http = new XMLHttpRequest();
|
|
126
|
-
var _serviceURL = window.webAuthSettings.authority + "/token-srv/prelogin/metadata/" + options.track_id + "?acceptLanguage=" + options.locale;
|
|
127
|
-
http.onreadystatechange = function () {
|
|
128
|
-
if (http.readyState == 4) {
|
|
129
|
-
if (http.responseText) {
|
|
130
|
-
resolve(JSON.parse(http.responseText));
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
133
|
-
resolve(false);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
http.open("GET", _serviceURL, true);
|
|
138
|
-
http.setRequestHeader("Content-type", "application/json");
|
|
139
|
-
if (window.localeSettings) {
|
|
140
|
-
http.setRequestHeader("accept-language", window.localeSettings);
|
|
141
|
-
}
|
|
142
|
-
http.send();
|
|
143
|
-
}
|
|
144
|
-
catch (ex) {
|
|
145
|
-
reject(ex);
|
|
146
|
-
}
|
|
147
|
-
});
|
|
66
|
+
var _serviceURL = window.webAuthSettings.authority + "/token-srv/prelogin/metadata/" + options.track_id + "?acceptLanguage=" + options.locale;
|
|
67
|
+
return Helper_1.Helper.createPostPromise(undefined, _serviceURL, false, "GET");
|
|
148
68
|
}
|
|
149
69
|
TokenService.getScopeConsentDetails = getScopeConsentDetails;
|
|
150
70
|
;
|
|
@@ -156,7 +76,7 @@ var TokenService;
|
|
|
156
76
|
*/
|
|
157
77
|
function updateSuggestMFA(track_id, options) {
|
|
158
78
|
var _serviceURL = window.webAuthSettings.authority + "/token-srv/prelogin/suggested/mfa/update/" + track_id;
|
|
159
|
-
return Helper_1.Helper.createPostPromise(options, _serviceURL, false);
|
|
79
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "POST");
|
|
160
80
|
}
|
|
161
81
|
TokenService.updateSuggestMFA = updateSuggestMFA;
|
|
162
82
|
;
|
|
@@ -166,31 +86,8 @@ var TokenService;
|
|
|
166
86
|
* @returns
|
|
167
87
|
*/
|
|
168
88
|
function getMissingFieldsLogin(trackId) {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
var http = new XMLHttpRequest();
|
|
172
|
-
var _serviceURL = window.webAuthSettings.authority + "/token-srv/prelogin/metadata/" + trackId;
|
|
173
|
-
http.onreadystatechange = function () {
|
|
174
|
-
if (http.readyState == 4) {
|
|
175
|
-
if (http.responseText) {
|
|
176
|
-
resolve(JSON.parse(http.responseText));
|
|
177
|
-
}
|
|
178
|
-
else {
|
|
179
|
-
resolve(undefined);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
http.open("GET", _serviceURL, true);
|
|
184
|
-
http.setRequestHeader("Content-type", "application/json");
|
|
185
|
-
if (window.localeSettings) {
|
|
186
|
-
http.setRequestHeader("accept-language", window.localeSettings);
|
|
187
|
-
}
|
|
188
|
-
http.send();
|
|
189
|
-
}
|
|
190
|
-
catch (ex) {
|
|
191
|
-
reject(ex);
|
|
192
|
-
}
|
|
193
|
-
});
|
|
89
|
+
var _serviceURL = window.webAuthSettings.authority + "/token-srv/prelogin/metadata/" + trackId;
|
|
90
|
+
return Helper_1.Helper.createPostPromise(undefined, _serviceURL, false, "GET");
|
|
194
91
|
}
|
|
195
92
|
TokenService.getMissingFieldsLogin = getMissingFieldsLogin;
|
|
196
93
|
;
|
|
@@ -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
|
;
|
|
@@ -176,34 +134,14 @@ var UserService;
|
|
|
176
134
|
*/
|
|
177
135
|
function handleResetPassword(options) {
|
|
178
136
|
try {
|
|
179
|
-
var
|
|
137
|
+
var url = window.webAuthSettings.authority + "/users-srv/resetpassword/validatecode";
|
|
180
138
|
if (window.webAuthSettings.cidaas_version > 2) {
|
|
181
|
-
var form = Helper_1.Helper.createForm(
|
|
139
|
+
var form = Helper_1.Helper.createForm(url, options);
|
|
182
140
|
document.body.appendChild(form);
|
|
183
141
|
form.submit();
|
|
184
142
|
}
|
|
185
143
|
else {
|
|
186
|
-
return
|
|
187
|
-
try {
|
|
188
|
-
var http = new XMLHttpRequest();
|
|
189
|
-
http.onreadystatechange = function () {
|
|
190
|
-
if (http.readyState == 4) {
|
|
191
|
-
if (http.responseText) {
|
|
192
|
-
resolve(JSON.parse(http.responseText));
|
|
193
|
-
}
|
|
194
|
-
else {
|
|
195
|
-
resolve(false);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
|
-
http.open("POST", url_1, true);
|
|
200
|
-
http.setRequestHeader("Content-type", "application/json");
|
|
201
|
-
http.send(JSON.stringify(options));
|
|
202
|
-
}
|
|
203
|
-
catch (ex) {
|
|
204
|
-
reject(ex);
|
|
205
|
-
}
|
|
206
|
-
});
|
|
144
|
+
return Helper_1.Helper.createPostPromise(options, url, false, "POST");
|
|
207
145
|
}
|
|
208
146
|
}
|
|
209
147
|
catch (ex) {
|
|
@@ -225,27 +163,7 @@ var UserService;
|
|
|
225
163
|
form.submit();
|
|
226
164
|
}
|
|
227
165
|
else {
|
|
228
|
-
return
|
|
229
|
-
try {
|
|
230
|
-
var http = new XMLHttpRequest();
|
|
231
|
-
http.onreadystatechange = function () {
|
|
232
|
-
if (http.readyState == 4) {
|
|
233
|
-
if (http.responseText) {
|
|
234
|
-
resolve(JSON.parse(http.responseText));
|
|
235
|
-
}
|
|
236
|
-
else {
|
|
237
|
-
resolve(false);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
};
|
|
241
|
-
http.open("POST", url, true);
|
|
242
|
-
http.setRequestHeader("Content-type", "application/json");
|
|
243
|
-
http.send(JSON.stringify(options));
|
|
244
|
-
}
|
|
245
|
-
catch (ex) {
|
|
246
|
-
reject(ex);
|
|
247
|
-
}
|
|
248
|
-
});
|
|
166
|
+
return Helper_1.Helper.createPostPromise(options, url, false, "POST");
|
|
249
167
|
}
|
|
250
168
|
}
|
|
251
169
|
catch (ex) {
|
|
@@ -260,31 +178,8 @@ var UserService;
|
|
|
260
178
|
* @returns
|
|
261
179
|
*/
|
|
262
180
|
function getDeduplicationDetails(options) {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
var http = new XMLHttpRequest();
|
|
266
|
-
var _serviceURL = window.webAuthSettings.authority + "/users-srv/deduplication/info/" + options.trackId;
|
|
267
|
-
http.onreadystatechange = function () {
|
|
268
|
-
if (http.readyState == 4) {
|
|
269
|
-
if (http.responseText) {
|
|
270
|
-
resolve(JSON.parse(http.responseText));
|
|
271
|
-
}
|
|
272
|
-
else {
|
|
273
|
-
resolve(false);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
};
|
|
277
|
-
http.open("GET", _serviceURL, true);
|
|
278
|
-
http.setRequestHeader("Content-type", "application/json");
|
|
279
|
-
if (window.localeSettings) {
|
|
280
|
-
http.setRequestHeader("accept-language", window.localeSettings);
|
|
281
|
-
}
|
|
282
|
-
http.send();
|
|
283
|
-
}
|
|
284
|
-
catch (ex) {
|
|
285
|
-
reject(ex);
|
|
286
|
-
}
|
|
287
|
-
});
|
|
181
|
+
var _serviceURL = window.webAuthSettings.authority + "/users-srv/deduplication/info/" + options.trackId;
|
|
182
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "GET", undefined);
|
|
288
183
|
}
|
|
289
184
|
UserService.getDeduplicationDetails = getDeduplicationDetails;
|
|
290
185
|
;
|
|
@@ -312,26 +207,8 @@ var UserService;
|
|
|
312
207
|
* @returns
|
|
313
208
|
*/
|
|
314
209
|
function registerDeduplication(options) {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
var http = new XMLHttpRequest();
|
|
318
|
-
var _serviceURL = window.webAuthSettings.authority + "/users-srv/deduplication/register/" + options.trackId;
|
|
319
|
-
http.onreadystatechange = function () {
|
|
320
|
-
if (http.readyState == 4) {
|
|
321
|
-
resolve(JSON.parse(http.responseText));
|
|
322
|
-
}
|
|
323
|
-
};
|
|
324
|
-
http.open("POST", _serviceURL, true);
|
|
325
|
-
http.setRequestHeader("Content-type", "application/json");
|
|
326
|
-
if (window.localeSettings) {
|
|
327
|
-
http.setRequestHeader("accept-language", window.localeSettings);
|
|
328
|
-
}
|
|
329
|
-
http.send();
|
|
330
|
-
}
|
|
331
|
-
catch (ex) {
|
|
332
|
-
reject(ex);
|
|
333
|
-
}
|
|
334
|
-
});
|
|
210
|
+
var _serviceURL = window.webAuthSettings.authority + "/users-srv/deduplication/register/" + options.trackId;
|
|
211
|
+
return Helper_1.Helper.createPostPromise(undefined, _serviceURL, undefined, "POST");
|
|
335
212
|
}
|
|
336
213
|
UserService.registerDeduplication = registerDeduplication;
|
|
337
214
|
;
|
|
@@ -343,7 +220,7 @@ var UserService;
|
|
|
343
220
|
*/
|
|
344
221
|
function changePassword(options, access_token) {
|
|
345
222
|
var _serviceURL = window.webAuthSettings.authority + "/users-srv/changepassword";
|
|
346
|
-
return Helper_1.Helper.createPostPromise(options, _serviceURL, false, access_token);
|
|
223
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "POST", access_token);
|
|
347
224
|
}
|
|
348
225
|
UserService.changePassword = changePassword;
|
|
349
226
|
;
|
|
@@ -355,32 +232,8 @@ var UserService;
|
|
|
355
232
|
* @returns
|
|
356
233
|
*/
|
|
357
234
|
function updateProfile(options, access_token, sub) {
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
var http = new XMLHttpRequest();
|
|
361
|
-
var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/profile/" + sub;
|
|
362
|
-
http.onreadystatechange = function () {
|
|
363
|
-
if (http.readyState == 4) {
|
|
364
|
-
if (http.responseText) {
|
|
365
|
-
resolve(JSON.parse(http.responseText));
|
|
366
|
-
}
|
|
367
|
-
else {
|
|
368
|
-
resolve(false);
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
};
|
|
372
|
-
http.open("PUT", _serviceURL, true);
|
|
373
|
-
http.setRequestHeader("Content-type", "application/json");
|
|
374
|
-
http.setRequestHeader("Authorization", "Bearer ".concat(access_token));
|
|
375
|
-
if (window.localeSettings) {
|
|
376
|
-
http.setRequestHeader("accept-language", window.localeSettings);
|
|
377
|
-
}
|
|
378
|
-
http.send(JSON.stringify(options));
|
|
379
|
-
}
|
|
380
|
-
catch (ex) {
|
|
381
|
-
throw new Helper_1.CustomException(ex, 417);
|
|
382
|
-
}
|
|
383
|
-
});
|
|
235
|
+
var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/profile/" + sub;
|
|
236
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "PUT", access_token);
|
|
384
237
|
}
|
|
385
238
|
UserService.updateProfile = updateProfile;
|
|
386
239
|
;
|
|
@@ -393,7 +246,7 @@ var UserService;
|
|
|
393
246
|
function initiateLinkAccount(options, access_token) {
|
|
394
247
|
options.user_name_type = 'email';
|
|
395
248
|
var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/link/initiate";
|
|
396
|
-
return Helper_1.Helper.createPostPromise(options, _serviceURL, false, access_token);
|
|
249
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "POST", access_token);
|
|
397
250
|
}
|
|
398
251
|
UserService.initiateLinkAccount = initiateLinkAccount;
|
|
399
252
|
;
|
|
@@ -405,7 +258,7 @@ var UserService;
|
|
|
405
258
|
*/
|
|
406
259
|
function completeLinkAccount(options, access_token) {
|
|
407
260
|
var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/link/complete";
|
|
408
|
-
return Helper_1.Helper.createPostPromise(options, _serviceURL, false, access_token);
|
|
261
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "POST", access_token);
|
|
409
262
|
}
|
|
410
263
|
UserService.completeLinkAccount = completeLinkAccount;
|
|
411
264
|
;
|
|
@@ -417,7 +270,7 @@ var UserService;
|
|
|
417
270
|
*/
|
|
418
271
|
function getLinkedUsers(access_token, sub) {
|
|
419
272
|
var _serviceURL = window.webAuthSettings.authority + "/users-srv/userinfo/social/" + sub;
|
|
420
|
-
return Helper_1.Helper.createPostPromise(undefined, _serviceURL, false, access_token);
|
|
273
|
+
return Helper_1.Helper.createPostPromise(undefined, _serviceURL, false, "POST", access_token);
|
|
421
274
|
}
|
|
422
275
|
UserService.getLinkedUsers = getLinkedUsers;
|
|
423
276
|
;
|
|
@@ -429,7 +282,7 @@ var UserService;
|
|
|
429
282
|
*/
|
|
430
283
|
function unlinkAccount(access_token, identityId) {
|
|
431
284
|
var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/unlink/" + identityId;
|
|
432
|
-
return Helper_1.Helper.createPostPromise(undefined, _serviceURL, false, access_token);
|
|
285
|
+
return Helper_1.Helper.createPostPromise(undefined, _serviceURL, false, "POST", access_token);
|
|
433
286
|
}
|
|
434
287
|
UserService.unlinkAccount = unlinkAccount;
|
|
435
288
|
;
|
|
@@ -440,7 +293,7 @@ var UserService;
|
|
|
440
293
|
*/
|
|
441
294
|
function deleteUserAccount(options) {
|
|
442
295
|
var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/unregister/scheduler/schedule/" + options.sub;
|
|
443
|
-
return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined, options.access_token);
|
|
296
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined, "POST", options.access_token);
|
|
444
297
|
}
|
|
445
298
|
UserService.deleteUserAccount = deleteUserAccount;
|
|
446
299
|
;
|
|
@@ -451,7 +304,7 @@ var UserService;
|
|
|
451
304
|
*/
|
|
452
305
|
function userCheckExists(options) {
|
|
453
306
|
var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/checkexists/" + options.requestId;
|
|
454
|
-
return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined);
|
|
307
|
+
return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined, "POST");
|
|
455
308
|
}
|
|
456
309
|
UserService.userCheckExists = userCheckExists;
|
|
457
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 = {}));
|