cidaas-javascript-sdk 4.2.0 → 4.2.2
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 +29 -3
- package/dist/authentication/authentication.model.d.ts +62 -0
- package/dist/authentication/authentication.model.js +18 -0
- package/dist/authentication/index.d.ts +31 -15
- package/dist/authentication/index.js +50 -45
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -5
- package/dist/web-auth/ConsentService.js +10 -13
- package/dist/web-auth/Entities.js +20 -39
- package/dist/web-auth/Helper.js +12 -22
- package/dist/web-auth/JwtHelper.js +21 -28
- package/dist/web-auth/LoginService.js +19 -22
- package/dist/web-auth/TokenService.js +46 -85
- package/dist/web-auth/UserService.js +38 -41
- package/dist/web-auth/VerificationService.js +18 -21
- package/dist/web-auth/WebAuth.d.ts +55 -32
- package/dist/web-auth/WebAuth.js +319 -343
- package/package.json +1 -1
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.UserService = void 0;
|
|
4
|
-
var Helper_1 = require("./Helper");
|
|
5
|
-
var UserService;
|
|
1
|
+
import { Helper, CustomException } from "./Helper";
|
|
2
|
+
export var UserService;
|
|
6
3
|
(function (UserService) {
|
|
7
4
|
/**
|
|
8
5
|
* To get the user profile information by using cidaas internal api, call **getUserProfile()**.
|
|
@@ -22,10 +19,10 @@ var UserService;
|
|
|
22
19
|
*/
|
|
23
20
|
function getUserProfile(options) {
|
|
24
21
|
if (!options.access_token) {
|
|
25
|
-
throw new
|
|
22
|
+
throw new CustomException("access_token cannot be empty", 417);
|
|
26
23
|
}
|
|
27
|
-
|
|
28
|
-
return
|
|
24
|
+
const _serviceURL = window.webAuthSettings.authority + "/users-srv/userinfo";
|
|
25
|
+
return Helper.createHttpPromise(undefined, _serviceURL, undefined, "GET", options.access_token);
|
|
29
26
|
}
|
|
30
27
|
UserService.getUserProfile = getUserProfile;
|
|
31
28
|
;
|
|
@@ -58,11 +55,11 @@ var UserService;
|
|
|
58
55
|
*```
|
|
59
56
|
*/
|
|
60
57
|
function register(options, headers) {
|
|
61
|
-
|
|
58
|
+
let _serviceURL = window.webAuthSettings.authority + "/users-srv/register";
|
|
62
59
|
if (options.invite_id) {
|
|
63
60
|
_serviceURL = _serviceURL + "?invite_id=" + options.invite_id;
|
|
64
61
|
}
|
|
65
|
-
return
|
|
62
|
+
return Helper.createHttpPromise(options, _serviceURL, false, "POST", undefined, headers);
|
|
66
63
|
}
|
|
67
64
|
UserService.register = register;
|
|
68
65
|
;
|
|
@@ -85,14 +82,14 @@ var UserService;
|
|
|
85
82
|
* ```
|
|
86
83
|
*/
|
|
87
84
|
function getInviteUserDetails(options) {
|
|
88
|
-
|
|
85
|
+
let _serviceURL = "";
|
|
89
86
|
if (options.callLatestAPI) {
|
|
90
87
|
_serviceURL = window.webAuthSettings.authority + "/useractions-srv/invitations/" + options.invite_id;
|
|
91
88
|
}
|
|
92
89
|
else {
|
|
93
90
|
_serviceURL = window.webAuthSettings.authority + "/users-srv/invite/info/" + options.invite_id;
|
|
94
91
|
}
|
|
95
|
-
return
|
|
92
|
+
return Helper.createHttpPromise(undefined, _serviceURL, false, "GET");
|
|
96
93
|
}
|
|
97
94
|
UserService.getInviteUserDetails = getInviteUserDetails;
|
|
98
95
|
;
|
|
@@ -110,8 +107,8 @@ var UserService;
|
|
|
110
107
|
* ```
|
|
111
108
|
*/
|
|
112
109
|
function getCommunicationStatus(options, headers) {
|
|
113
|
-
|
|
114
|
-
return
|
|
110
|
+
let _serviceURL = window.webAuthSettings.authority + "/users-srv/user/communication/status/" + options.sub;
|
|
111
|
+
return Helper.createHttpPromise(undefined, _serviceURL, false, "GET", undefined, headers);
|
|
115
112
|
}
|
|
116
113
|
UserService.getCommunicationStatus = getCommunicationStatus;
|
|
117
114
|
;
|
|
@@ -134,7 +131,7 @@ var UserService;
|
|
|
134
131
|
*/
|
|
135
132
|
function initiateResetPassword(options) {
|
|
136
133
|
var _serviceURL = window.webAuthSettings.authority + "/users-srv/resetpassword/initiate";
|
|
137
|
-
return
|
|
134
|
+
return Helper.createHttpPromise(options, _serviceURL, false, "POST");
|
|
138
135
|
}
|
|
139
136
|
UserService.initiateResetPassword = initiateResetPassword;
|
|
140
137
|
;
|
|
@@ -156,20 +153,20 @@ var UserService;
|
|
|
156
153
|
*/
|
|
157
154
|
function handleResetPassword(options, handleResponseAsJson) {
|
|
158
155
|
try {
|
|
159
|
-
|
|
156
|
+
const url = window.webAuthSettings.authority + "/users-srv/resetpassword/validatecode";
|
|
160
157
|
if (!handleResponseAsJson) {
|
|
161
158
|
// current handling will redirect and give query parameters
|
|
162
|
-
|
|
159
|
+
let form = Helper.createForm(url, options);
|
|
163
160
|
document.body.appendChild(form);
|
|
164
161
|
form.submit();
|
|
165
162
|
}
|
|
166
163
|
else {
|
|
167
164
|
// older cidaas service handling return json object
|
|
168
|
-
return
|
|
165
|
+
return Helper.createHttpPromise(options, url, false, "POST");
|
|
169
166
|
}
|
|
170
167
|
}
|
|
171
168
|
catch (ex) {
|
|
172
|
-
throw new
|
|
169
|
+
throw new CustomException(ex, 417);
|
|
173
170
|
}
|
|
174
171
|
}
|
|
175
172
|
UserService.handleResetPassword = handleResetPassword;
|
|
@@ -193,21 +190,21 @@ var UserService;
|
|
|
193
190
|
* ```
|
|
194
191
|
*/
|
|
195
192
|
function resetPassword(options, handleResponseAsJson) {
|
|
196
|
-
|
|
193
|
+
const url = window.webAuthSettings.authority + "/users-srv/resetpassword/accept";
|
|
197
194
|
try {
|
|
198
195
|
if (!handleResponseAsJson) {
|
|
199
196
|
// current handling will redirect and give query parameters
|
|
200
|
-
|
|
197
|
+
let form = Helper.createForm(url, options);
|
|
201
198
|
document.body.appendChild(form);
|
|
202
199
|
form.submit();
|
|
203
200
|
}
|
|
204
201
|
else {
|
|
205
202
|
// older cidaas service handling return json object
|
|
206
|
-
return
|
|
203
|
+
return Helper.createHttpPromise(options, url, false, "POST");
|
|
207
204
|
}
|
|
208
205
|
}
|
|
209
206
|
catch (ex) {
|
|
210
|
-
throw new
|
|
207
|
+
throw new CustomException(ex, 417);
|
|
211
208
|
}
|
|
212
209
|
}
|
|
213
210
|
UserService.resetPassword = resetPassword;
|
|
@@ -226,8 +223,8 @@ var UserService;
|
|
|
226
223
|
* ```
|
|
227
224
|
*/
|
|
228
225
|
function getDeduplicationDetails(options) {
|
|
229
|
-
|
|
230
|
-
return
|
|
226
|
+
const _serviceURL = window.webAuthSettings.authority + "/users-srv/deduplication/info/" + options.trackId;
|
|
227
|
+
return Helper.createHttpPromise(options, _serviceURL, false, "GET");
|
|
231
228
|
}
|
|
232
229
|
UserService.getDeduplicationDetails = getDeduplicationDetails;
|
|
233
230
|
;
|
|
@@ -244,13 +241,13 @@ var UserService;
|
|
|
244
241
|
*/
|
|
245
242
|
function deduplicationLogin(options) {
|
|
246
243
|
try {
|
|
247
|
-
|
|
248
|
-
|
|
244
|
+
const url = window.webAuthSettings.authority + "/users-srv/deduplication/login/redirection?trackId=" + options.trackId + "&requestId=" + options.requestId + "&sub=" + options.sub;
|
|
245
|
+
const form = Helper.createForm(url, {});
|
|
249
246
|
document.body.appendChild(form);
|
|
250
247
|
form.submit();
|
|
251
248
|
}
|
|
252
249
|
catch (ex) {
|
|
253
|
-
throw new
|
|
250
|
+
throw new CustomException(ex, 417);
|
|
254
251
|
}
|
|
255
252
|
}
|
|
256
253
|
UserService.deduplicationLogin = deduplicationLogin;
|
|
@@ -269,8 +266,8 @@ var UserService;
|
|
|
269
266
|
* ```
|
|
270
267
|
*/
|
|
271
268
|
function registerDeduplication(options) {
|
|
272
|
-
|
|
273
|
-
return
|
|
269
|
+
const _serviceURL = window.webAuthSettings.authority + "/users-srv/deduplication/register/" + options.trackId;
|
|
270
|
+
return Helper.createHttpPromise(undefined, _serviceURL, undefined, "POST");
|
|
274
271
|
}
|
|
275
272
|
UserService.registerDeduplication = registerDeduplication;
|
|
276
273
|
;
|
|
@@ -294,7 +291,7 @@ var UserService;
|
|
|
294
291
|
*/
|
|
295
292
|
function changePassword(options, access_token) {
|
|
296
293
|
var _serviceURL = window.webAuthSettings.authority + "/users-srv/changepassword";
|
|
297
|
-
return
|
|
294
|
+
return Helper.createHttpPromise(options, _serviceURL, false, "POST", access_token);
|
|
298
295
|
}
|
|
299
296
|
UserService.changePassword = changePassword;
|
|
300
297
|
;
|
|
@@ -316,8 +313,8 @@ var UserService;
|
|
|
316
313
|
* ```
|
|
317
314
|
*/
|
|
318
315
|
function updateProfile(options, access_token, sub) {
|
|
319
|
-
|
|
320
|
-
return
|
|
316
|
+
const _serviceURL = window.webAuthSettings.authority + "/users-srv/user/profile/" + sub;
|
|
317
|
+
return Helper.createHttpPromise(options, _serviceURL, false, "PUT", access_token);
|
|
321
318
|
}
|
|
322
319
|
UserService.updateProfile = updateProfile;
|
|
323
320
|
;
|
|
@@ -341,7 +338,7 @@ var UserService;
|
|
|
341
338
|
function initiateLinkAccount(options, access_token) {
|
|
342
339
|
options.user_name_type = 'email';
|
|
343
340
|
var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/link/initiate";
|
|
344
|
-
return
|
|
341
|
+
return Helper.createHttpPromise(options, _serviceURL, false, "POST", access_token);
|
|
345
342
|
}
|
|
346
343
|
UserService.initiateLinkAccount = initiateLinkAccount;
|
|
347
344
|
;
|
|
@@ -363,7 +360,7 @@ var UserService;
|
|
|
363
360
|
*/
|
|
364
361
|
function completeLinkAccount(options, access_token) {
|
|
365
362
|
var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/link/complete";
|
|
366
|
-
return
|
|
363
|
+
return Helper.createHttpPromise(options, _serviceURL, false, "POST", access_token);
|
|
367
364
|
}
|
|
368
365
|
UserService.completeLinkAccount = completeLinkAccount;
|
|
369
366
|
;
|
|
@@ -385,7 +382,7 @@ var UserService;
|
|
|
385
382
|
*/
|
|
386
383
|
function getLinkedUsers(access_token, sub) {
|
|
387
384
|
var _serviceURL = window.webAuthSettings.authority + "/users-srv/userinfo/social/" + sub;
|
|
388
|
-
return
|
|
385
|
+
return Helper.createHttpPromise(undefined, _serviceURL, false, "GET", access_token);
|
|
389
386
|
}
|
|
390
387
|
UserService.getLinkedUsers = getLinkedUsers;
|
|
391
388
|
;
|
|
@@ -407,7 +404,7 @@ var UserService;
|
|
|
407
404
|
*/
|
|
408
405
|
function unlinkAccount(access_token, identityId) {
|
|
409
406
|
var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/unlink/" + identityId;
|
|
410
|
-
return
|
|
407
|
+
return Helper.createHttpPromise(undefined, _serviceURL, false, "POST", access_token);
|
|
411
408
|
}
|
|
412
409
|
UserService.unlinkAccount = unlinkAccount;
|
|
413
410
|
;
|
|
@@ -430,7 +427,7 @@ var UserService;
|
|
|
430
427
|
*/
|
|
431
428
|
function deleteUserAccount(options) {
|
|
432
429
|
var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/unregister/scheduler/schedule/" + options.sub;
|
|
433
|
-
return
|
|
430
|
+
return Helper.createHttpPromise(options, _serviceURL, undefined, "POST", options.access_token);
|
|
434
431
|
}
|
|
435
432
|
UserService.deleteUserAccount = deleteUserAccount;
|
|
436
433
|
;
|
|
@@ -450,7 +447,7 @@ var UserService;
|
|
|
450
447
|
* ```
|
|
451
448
|
*/
|
|
452
449
|
function userCheckExists(options) {
|
|
453
|
-
|
|
450
|
+
let queryParameter = '';
|
|
454
451
|
if (options.webfinger || options.rememberMe) {
|
|
455
452
|
queryParameter += '?';
|
|
456
453
|
if (options.webfinger) {
|
|
@@ -464,8 +461,8 @@ var UserService;
|
|
|
464
461
|
}
|
|
465
462
|
}
|
|
466
463
|
var _serviceURL = window.webAuthSettings.authority + "/useractions-srv/userexistence/" + options.requestId + queryParameter;
|
|
467
|
-
return
|
|
464
|
+
return Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
|
|
468
465
|
}
|
|
469
466
|
UserService.userCheckExists = userCheckExists;
|
|
470
467
|
;
|
|
471
|
-
})(UserService
|
|
468
|
+
})(UserService || (UserService = {}));
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.VerificationService = void 0;
|
|
4
|
-
var Helper_1 = require("./Helper");
|
|
5
|
-
var VerificationService;
|
|
1
|
+
import { Helper, CustomException } from "./Helper";
|
|
2
|
+
export var VerificationService;
|
|
6
3
|
(function (VerificationService) {
|
|
7
4
|
/**
|
|
8
5
|
* To initiate the account verification, call **initiateAccountVerification()**. This will send verification code email or sms or ivr based on the verificationMedium you mentioned.
|
|
@@ -23,13 +20,13 @@ var VerificationService;
|
|
|
23
20
|
*/
|
|
24
21
|
function initiateAccountVerification(options) {
|
|
25
22
|
try {
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
const url = window.webAuthSettings.authority + "/verification-srv/account/initiate";
|
|
24
|
+
let form = Helper.createForm(url, options);
|
|
28
25
|
document.body.appendChild(form);
|
|
29
26
|
form.submit();
|
|
30
27
|
}
|
|
31
28
|
catch (ex) {
|
|
32
|
-
throw new
|
|
29
|
+
throw new CustomException(ex, 417);
|
|
33
30
|
}
|
|
34
31
|
}
|
|
35
32
|
VerificationService.initiateAccountVerification = initiateAccountVerification;
|
|
@@ -51,7 +48,7 @@ var VerificationService;
|
|
|
51
48
|
*/
|
|
52
49
|
function verifyAccount(options) {
|
|
53
50
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/account/verify";
|
|
54
|
-
return
|
|
51
|
+
return Helper.createHttpPromise(options, _serviceURL, false, "POST");
|
|
55
52
|
}
|
|
56
53
|
VerificationService.verifyAccount = verifyAccount;
|
|
57
54
|
;
|
|
@@ -72,7 +69,7 @@ var VerificationService;
|
|
|
72
69
|
*/
|
|
73
70
|
function getMFAList(options) {
|
|
74
71
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/public/configured/list";
|
|
75
|
-
return
|
|
72
|
+
return Helper.createHttpPromise(options, _serviceURL, false, "POST");
|
|
76
73
|
}
|
|
77
74
|
VerificationService.getMFAList = getMFAList;
|
|
78
75
|
;
|
|
@@ -93,7 +90,7 @@ var VerificationService;
|
|
|
93
90
|
*/
|
|
94
91
|
function cancelMFA(options) {
|
|
95
92
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/authenticate/cancel/" + options.type;
|
|
96
|
-
return
|
|
93
|
+
return Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
|
|
97
94
|
}
|
|
98
95
|
VerificationService.cancelMFA = cancelMFA;
|
|
99
96
|
;
|
|
@@ -113,8 +110,8 @@ var VerificationService;
|
|
|
113
110
|
* ```
|
|
114
111
|
*/
|
|
115
112
|
function getAllVerificationList(access_token) {
|
|
116
|
-
|
|
117
|
-
return
|
|
113
|
+
const _serviceURL = `${window.webAuthSettings.authority}/verification-srv/config/list`;
|
|
114
|
+
return Helper.createHttpPromise(undefined, _serviceURL, undefined, "GET", access_token);
|
|
118
115
|
}
|
|
119
116
|
VerificationService.getAllVerificationList = getAllVerificationList;
|
|
120
117
|
;
|
|
@@ -143,7 +140,7 @@ var VerificationService;
|
|
|
143
140
|
*/
|
|
144
141
|
function initiateEnrollment(options, accessToken) {
|
|
145
142
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/initiate/" + options.verification_type;
|
|
146
|
-
return
|
|
143
|
+
return Helper.createHttpPromise(options, _serviceURL, undefined, "POST", accessToken);
|
|
147
144
|
}
|
|
148
145
|
VerificationService.initiateEnrollment = initiateEnrollment;
|
|
149
146
|
;
|
|
@@ -163,7 +160,7 @@ var VerificationService;
|
|
|
163
160
|
*/
|
|
164
161
|
function getEnrollmentStatus(status_id, accessToken) {
|
|
165
162
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/notification/status/" + status_id;
|
|
166
|
-
return
|
|
163
|
+
return Helper.createHttpPromise(undefined, _serviceURL, undefined, "POST", accessToken);
|
|
167
164
|
}
|
|
168
165
|
VerificationService.getEnrollmentStatus = getEnrollmentStatus;
|
|
169
166
|
;
|
|
@@ -192,7 +189,7 @@ var VerificationService;
|
|
|
192
189
|
*/
|
|
193
190
|
function enrollVerification(options) {
|
|
194
191
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/enroll/" + options.verification_type;
|
|
195
|
-
return
|
|
192
|
+
return Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
|
|
196
193
|
}
|
|
197
194
|
VerificationService.enrollVerification = enrollVerification;
|
|
198
195
|
;
|
|
@@ -214,7 +211,7 @@ var VerificationService;
|
|
|
214
211
|
*/
|
|
215
212
|
function checkVerificationTypeConfigured(options) {
|
|
216
213
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/public/configured/check/" + options.verification_type;
|
|
217
|
-
return
|
|
214
|
+
return Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
|
|
218
215
|
}
|
|
219
216
|
VerificationService.checkVerificationTypeConfigured = checkVerificationTypeConfigured;
|
|
220
217
|
;
|
|
@@ -245,9 +242,9 @@ var VerificationService;
|
|
|
245
242
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/authenticate/initiate/" + options.type;
|
|
246
243
|
// TODO: remove accessToken parameter in the next major release
|
|
247
244
|
if (accessToken) {
|
|
248
|
-
return
|
|
245
|
+
return Helper.createHttpPromise(options, _serviceURL, false, "POST", accessToken);
|
|
249
246
|
}
|
|
250
|
-
return
|
|
247
|
+
return Helper.createHttpPromise(options, _serviceURL, false, "POST");
|
|
251
248
|
}
|
|
252
249
|
VerificationService.initiateMFA = initiateMFA;
|
|
253
250
|
;
|
|
@@ -271,8 +268,8 @@ var VerificationService;
|
|
|
271
268
|
*/
|
|
272
269
|
function authenticateMFA(options) {
|
|
273
270
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/authenticate/authenticate/" + options.type;
|
|
274
|
-
return
|
|
271
|
+
return Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
|
|
275
272
|
}
|
|
276
273
|
VerificationService.authenticateMFA = authenticateMFA;
|
|
277
274
|
;
|
|
278
|
-
})(VerificationService
|
|
275
|
+
})(VerificationService || (VerificationService = {}));
|
|
@@ -1,39 +1,58 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OidcSettings, LoginRedirectOptions, LogoutRedirectOptions, PopupSignInOptions, PopupSignOutOptions, SilentSignInOptions, LoginRequestOptions, User, LogoutResponse } from '../authentication';
|
|
2
2
|
import { AccessTokenRequest, TokenIntrospectionEntity, UserEntity, ResetPasswordEntity, IConfiguredListRequestEntity, IInitVerificationAuthenticationRequestEntity, FindUserEntity, IUserEntity, IEnrollVerificationSetupRequestEntity, IUserLinkEntity, ChangePasswordEntity, IConsentAcceptEntity, IAuthVerificationAuthenticationRequestEntity, LoginFormRequestEntity, AccountVerificationRequestEntity, ValidateResetPasswordEntity, AcceptResetPasswordEntity, PhysicalVerificationLoginRequest, IChangePasswordEntity, IUserActivityPayloadEntity } from "./Entities";
|
|
3
3
|
export declare const createPreloginWebauth: (authority: string) => WebAuth;
|
|
4
4
|
export declare class WebAuth {
|
|
5
|
-
constructor(settings:
|
|
5
|
+
constructor(settings: OidcSettings);
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Generate and redirect to authz url in same window for logging in.
|
|
8
|
+
* @param {LoginRedirectOptions} options options options to over-ride the client config for redirect login
|
|
8
9
|
*/
|
|
9
|
-
loginWithBrowser():
|
|
10
|
+
loginWithBrowser(options?: LoginRedirectOptions): Promise<void>;
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
+
* Generate and open authz url in a popup window.
|
|
13
|
+
* On successful sign in, authenticated user is returned.
|
|
14
|
+
*
|
|
15
|
+
* @param {PopupSignInOptions} options options to over-ride the client config for popup sign in
|
|
16
|
+
* @returns {Promise<User>} Authenticated user
|
|
17
|
+
* @throws error if unable to get the parse and get user
|
|
12
18
|
*/
|
|
13
|
-
popupSignIn():
|
|
19
|
+
popupSignIn(options?: PopupSignInOptions): Promise<User>;
|
|
14
20
|
/**
|
|
15
|
-
*
|
|
21
|
+
* Generate and navigate to authz url in an iFrame.
|
|
22
|
+
* On successful sign in, authenticated user is returned
|
|
23
|
+
*
|
|
24
|
+
* @param {SilentSignInOptions} options options to over-ride the client config for silent sign in
|
|
25
|
+
* @returns {Promise<User>} Authenticated user
|
|
26
|
+
* @throws error if unable to get the parse and get user
|
|
16
27
|
*/
|
|
17
|
-
silentSignIn():
|
|
28
|
+
silentSignIn(options?: SilentSignInOptions): Promise<User>;
|
|
18
29
|
/**
|
|
19
|
-
* register
|
|
30
|
+
* Generate and redirect to authz url in same window for register view.
|
|
31
|
+
* @param {LoginRedirectOptions} options options options to over-ride the client config for redirect login
|
|
20
32
|
*/
|
|
21
|
-
registerWithBrowser():
|
|
33
|
+
registerWithBrowser(options?: LoginRedirectOptions): Promise<void>;
|
|
22
34
|
/**
|
|
23
|
-
* login
|
|
24
|
-
*
|
|
35
|
+
* Once login successful, it will automatically redirects you to the redirect url whatever you mentioned in the options.
|
|
36
|
+
* To complete the login process, call **loginCallback()**. This will parses the access_token, id_token and whatever in hash in the redirect url.
|
|
37
|
+
*
|
|
38
|
+
* @param {string} url optional url from where to process the login state
|
|
39
|
+
* @returns {Promise<User>} Authenticated user
|
|
40
|
+
* @throws error if unable to get the parse and get user
|
|
25
41
|
*/
|
|
26
|
-
loginCallback():
|
|
42
|
+
loginCallback(url?: string): Promise<User>;
|
|
27
43
|
/**
|
|
28
|
-
* popup
|
|
29
|
-
*
|
|
44
|
+
* To complete the popup login process, call **popupSignInCallback()** from the popup login window.
|
|
45
|
+
* Popup window will be closed after doing callback
|
|
46
|
+
*
|
|
47
|
+
* @param {string} url optional url to read sign-in callback state from
|
|
48
|
+
* @param {boolean} keepOpen true to keep the popup open even after sign in, else false
|
|
30
49
|
*/
|
|
31
|
-
popupSignInCallback():
|
|
50
|
+
popupSignInCallback(url?: string, keepOpen?: boolean): Promise<void>;
|
|
32
51
|
/**
|
|
33
|
-
*
|
|
34
|
-
* @
|
|
52
|
+
* Returns a promise to notify the parent window of response from authz service
|
|
53
|
+
* @param {string} url optional url to check authz response, if none window.location is used
|
|
35
54
|
*/
|
|
36
|
-
silentSignInCallback():
|
|
55
|
+
silentSignInCallback(url?: string): Promise<void>;
|
|
37
56
|
/**
|
|
38
57
|
* To get the user profile information by using oidc-client-ts library, call **getUserInfo()**. This will return the basic user profile details along with groups, roles and whatever scopes you mentioned in the options.
|
|
39
58
|
* @example
|
|
@@ -44,28 +63,30 @@ export declare class WebAuth {
|
|
|
44
63
|
* // your failure code here
|
|
45
64
|
* });
|
|
46
65
|
* ```
|
|
66
|
+
* @return {Promise<User|null>} returns authenticated user if present, else null
|
|
47
67
|
*/
|
|
48
|
-
getUserInfo(): Promise<
|
|
68
|
+
getUserInfo(): Promise<User | null>;
|
|
49
69
|
/**
|
|
50
70
|
* logout by using oidc-client-ts library
|
|
51
|
-
* @
|
|
71
|
+
* @param {LogoutRedirectOptions} options optional options to over-ride logout options on redirect
|
|
52
72
|
*/
|
|
53
|
-
logout():
|
|
73
|
+
logout(options?: LogoutRedirectOptions): Promise<void>;
|
|
54
74
|
/**
|
|
55
|
-
*
|
|
56
|
-
* @
|
|
75
|
+
* logout by using oidc-client-ts library
|
|
76
|
+
* @param {PopupSignOutOptions} options optional options to over-ride logout options using popup window
|
|
57
77
|
*/
|
|
58
|
-
popupSignOut():
|
|
78
|
+
popupSignOut(options?: PopupSignOutOptions): Promise<void>;
|
|
59
79
|
/**
|
|
60
|
-
* logout
|
|
61
|
-
* @returns
|
|
80
|
+
* get the logout call state from the url provided, if none is provided current window url is used
|
|
81
|
+
* @returns {Promise<LogoutResponse>} logout response from auth service
|
|
62
82
|
*/
|
|
63
|
-
logoutCallback():
|
|
83
|
+
logoutCallback(url?: string): Promise<LogoutResponse>;
|
|
64
84
|
/**
|
|
65
|
-
* popup
|
|
66
|
-
* @
|
|
85
|
+
* listen to popup sign out event
|
|
86
|
+
* @param {string} url optional url to override to check for sign out state
|
|
87
|
+
* @param {boolean} keepOpen true to keep the popup open even after sign out, else false
|
|
67
88
|
*/
|
|
68
|
-
popupSignOutCallback():
|
|
89
|
+
popupSignOutCallback(url?: string, keepOpen?: boolean): Promise<void>;
|
|
69
90
|
/**
|
|
70
91
|
* To get the generated login url, call **getLoginURL()**. This will call authz service and generate login url to be used.
|
|
71
92
|
* @example
|
|
@@ -76,8 +97,10 @@ export declare class WebAuth {
|
|
|
76
97
|
* // your failure code here
|
|
77
98
|
* });
|
|
78
99
|
* ```
|
|
100
|
+
* @param {LoginRequestOptions} options login options to override {@link window.webAuthSettings} provided
|
|
101
|
+
* @return {Promise<string>} authz url for login
|
|
79
102
|
*/
|
|
80
|
-
getLoginURL(
|
|
103
|
+
getLoginURL(options?: LoginRequestOptions): Promise<string>;
|
|
81
104
|
/**
|
|
82
105
|
* Each and every proccesses starts with requestId, it is an entry point to login or register. For getting the requestId, call **getRequestId()**.
|
|
83
106
|
* @example
|