cidaas-javascript-sdk 4.3.1 → 4.3.3
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 +13 -15
- package/README.md +0 -1
- package/dist/login-service/LoginService.model.d.ts +2 -2
- package/dist/verification-service/VerificationService.d.ts +6 -0
- package/dist/verification-service/VerificationService.js +6 -0
- package/dist/verification-service/VerificationService.model.d.ts +16 -2
- package/dist/web-auth/WebAuth.d.ts +8 -1
- package/dist/web-auth/WebAuth.js +10 -12
- package/dist/web-auth/webauth.model.d.ts +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
## [4.3.
|
|
1
|
+
## [4.3.3](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/compare/v4.3.2...v4.3.3) (2024-11-28)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Bug Fixes
|
|
5
5
|
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* [#438](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/issues/438) test coverage fixes ([49e580d](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/49e580d0650963510cfcd9d29d415814b7a90b5c))
|
|
9
|
-
* **[270](https://gitlab.widas.de/cidaas-v2/PortalNDashboard-Team/issues/-/issues/270):** add accepting parameter lat, lon in headers in required ConsentService functions ([f223ebb](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/f223ebb2f00b5350a65106c861d2daff1dda7a2a))
|
|
10
|
-
* **[270](https://gitlab.widas.de/cidaas-v2/PortalNDashboard-Team/issues/-/issues/270):** add accepting parameter lat, lon in headers in required ConsentService getConsentDetails function ([b08f870](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/b08f870032c4c24f4bfc51d6a7812964b60b42e0))
|
|
11
|
-
* **[270](https://gitlab.widas.de/cidaas-v2/PortalNDashboard-Team/issues/-/issues/270):** add accepting parameter lat, lon in headers in required LoginService functions ([f440983](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/f440983d8e19a4a74a5eff0f1bf321c1f1fe5528))
|
|
12
|
-
* **[270](https://gitlab.widas.de/cidaas-v2/PortalNDashboard-Team/issues/-/issues/270):** add accepting parameter lat, lon in headers in required TokenService functions ([89aaf5a](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/89aaf5a15609e1bda80f1965129ffc596f39a4b3))
|
|
13
|
-
* **[270](https://gitlab.widas.de/cidaas-v2/PortalNDashboard-Team/issues/-/issues/270):** add accepting parameter lat, lon in headers in required UserService functions ([fa3ad7e](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/fa3ad7e6f93b5bf3d110688c66cf02e2e72924c0))
|
|
14
|
-
* **[270](https://gitlab.widas.de/cidaas-v2/PortalNDashboard-Team/issues/-/issues/270):** add accepting parameter lat, lon in headers in required VerificationService functions ([5e5c1d0](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/5e5c1d00453787c56395f35d1fd732d40b1134c5))
|
|
15
|
-
* 438 [Javascript SDK] make getRequestId function flexible ([ff6f2dd](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/ff6f2ddecf7e9029df95935e3ba7d8eb4569e15b))
|
|
16
|
-
* 438 review changes ([6dd54c0](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/6dd54c0f258b98d32de851cb27040374fe71c429))
|
|
17
|
-
* Fix vulnerabilities from npm audit ([9e89a88](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/9e89a8827fda8acf2366b1b737fa06593066bb10))
|
|
18
|
-
* update changelog ([1b236b5](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/1b236b56feaf38ec1cdc1118f56deb1a5be0b3c1))
|
|
19
|
-
* upgrade oidc-client-ts from 2.4.0 to 2.4.1 ([126a62f](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/126a62f354d0200dc772798922e584978291b036))
|
|
6
|
+
* fix vulnerabilty from npm audit ([2f8e0c5](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/2f8e0c5498e45d865ad4bdca8005339d5857c37e))
|
|
7
|
+
* semantic release format ([0d8b601](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/0d8b6014a673098a44d18297777ce1c65ba35602))
|
|
20
8
|
|
|
21
9
|
# Changelog
|
|
22
10
|
|
|
11
|
+
## V4.3.3
|
|
12
|
+
|
|
13
|
+
## Changed
|
|
14
|
+
- Update GetMFAListRequest to support more parameters
|
|
15
|
+
|
|
16
|
+
## V4.3.2
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
- Update getRequestId() to support overriding single option
|
|
20
|
+
|
|
23
21
|
## V4.3.1
|
|
24
22
|
|
|
25
23
|
### Changed
|
package/README.md
CHANGED
|
@@ -66,12 +66,12 @@ export interface PasswordlessLoginRequest {
|
|
|
66
66
|
* */
|
|
67
67
|
verificationType: VerificationType | string;
|
|
68
68
|
/**
|
|
69
|
-
* Masked sub (id of user)
|
|
69
|
+
* Masked sub (id of user)
|
|
70
70
|
* Either sub or q have to be provided, depends on what is given from the query parameter.
|
|
71
71
|
* */
|
|
72
72
|
sub?: string;
|
|
73
73
|
/**
|
|
74
|
-
* Masked sub (id of user)
|
|
74
|
+
* Masked sub (id of user)
|
|
75
75
|
* Either sub or q have to be provided, depends on what is given from the query parameter.
|
|
76
76
|
* */
|
|
77
77
|
q?: string;
|
|
@@ -36,6 +36,12 @@ export declare function initiateAccountVerification(options: InitiateAccountVeri
|
|
|
36
36
|
export declare function verifyAccount(options: VerifyAccountRequest, headers?: HTTPRequestHeader): Promise<any>;
|
|
37
37
|
/**
|
|
38
38
|
* To get all configured multi factor authentication, call **getMFAList()**.
|
|
39
|
+
*
|
|
40
|
+
* As Parameter, you need to pass request id & one of the following: email or mobile phone or username.
|
|
41
|
+
*
|
|
42
|
+
* In case you are in prelogin page and don't have user information yet (such as mfa-required & account-verification page), you could pass
|
|
43
|
+
* request id & masked sub (one of the following: sub or q), depends on which one is available in the query parameter generated by cidaas.
|
|
44
|
+
*
|
|
39
45
|
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/ee688a9c52b63-list-of-configured-verification-methods for more details.
|
|
40
46
|
* @example
|
|
41
47
|
* ```js
|
|
@@ -53,6 +53,12 @@ function verifyAccount(options, headers) {
|
|
|
53
53
|
exports.verifyAccount = verifyAccount;
|
|
54
54
|
/**
|
|
55
55
|
* To get all configured multi factor authentication, call **getMFAList()**.
|
|
56
|
+
*
|
|
57
|
+
* As Parameter, you need to pass request id & one of the following: email or mobile phone or username.
|
|
58
|
+
*
|
|
59
|
+
* In case you are in prelogin page and don't have user information yet (such as mfa-required & account-verification page), you could pass
|
|
60
|
+
* request id & masked sub (one of the following: sub or q), depends on which one is available in the query parameter generated by cidaas.
|
|
61
|
+
*
|
|
56
62
|
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/ee688a9c52b63-list-of-configured-verification-methods for more details.
|
|
57
63
|
* @example
|
|
58
64
|
* ```js
|
|
@@ -39,10 +39,24 @@ export interface VerifyAccountRequest {
|
|
|
39
39
|
code: string;
|
|
40
40
|
}
|
|
41
41
|
export interface GetMFAListRequest {
|
|
42
|
-
/** email of user */
|
|
43
|
-
email: string;
|
|
44
42
|
/** Request id returned from the authorization call */
|
|
45
43
|
request_id: string;
|
|
44
|
+
/** Email of the user */
|
|
45
|
+
email?: string;
|
|
46
|
+
/** Mobile number of the user */
|
|
47
|
+
mobile_number?: string;
|
|
48
|
+
/** Username of the user */
|
|
49
|
+
username?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Masked sub (id of user)
|
|
52
|
+
* Either sub or q have to be provided, depends on what is given from the query parameter.
|
|
53
|
+
* */
|
|
54
|
+
sub?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Masked sub (id of user)
|
|
57
|
+
* Either sub or q have to be provided, depends on what is given from the query parameter.
|
|
58
|
+
* */
|
|
59
|
+
q?: string;
|
|
46
60
|
}
|
|
47
61
|
export interface CancelMFARequest {
|
|
48
62
|
/** comes from initiate MFA process */
|
|
@@ -114,10 +114,17 @@ export declare class WebAuth {
|
|
|
114
114
|
* Each and every proccesses starts with requestId, it is an entry point to login or register. For getting the requestId, call **getRequestId()**.
|
|
115
115
|
* @example
|
|
116
116
|
* ```js
|
|
117
|
+
* // To get requestId using default configured settings, run the function without parameter
|
|
118
|
+
* cidaas.getRequestId().then(function (response) {
|
|
119
|
+
* // the response will give you request id.
|
|
120
|
+
* }).catch(function(ex) {
|
|
121
|
+
* // your failure code here
|
|
122
|
+
* });
|
|
123
|
+
*
|
|
124
|
+
* // To get requestId using custom settings, run the function with custom setting(s) inside option parameter. Example below will only override client_id & redirect_uri
|
|
117
125
|
* const option: GetRequestIdRequest = {
|
|
118
126
|
* 'client_id': 'your client id',
|
|
119
127
|
* 'redirect_uri': 'your redirect url',
|
|
120
|
-
* 'scope': 'your scopes',
|
|
121
128
|
* }
|
|
122
129
|
* cidaas.getRequestId(option).then(function (response) {
|
|
123
130
|
* // the response will give you request id.
|
package/dist/web-auth/WebAuth.js
CHANGED
|
@@ -224,10 +224,17 @@ class WebAuth {
|
|
|
224
224
|
* Each and every proccesses starts with requestId, it is an entry point to login or register. For getting the requestId, call **getRequestId()**.
|
|
225
225
|
* @example
|
|
226
226
|
* ```js
|
|
227
|
+
* // To get requestId using default configured settings, run the function without parameter
|
|
228
|
+
* cidaas.getRequestId().then(function (response) {
|
|
229
|
+
* // the response will give you request id.
|
|
230
|
+
* }).catch(function(ex) {
|
|
231
|
+
* // your failure code here
|
|
232
|
+
* });
|
|
233
|
+
*
|
|
234
|
+
* // To get requestId using custom settings, run the function with custom setting(s) inside option parameter. Example below will only override client_id & redirect_uri
|
|
227
235
|
* const option: GetRequestIdRequest = {
|
|
228
236
|
* 'client_id': 'your client id',
|
|
229
237
|
* 'redirect_uri': 'your redirect url',
|
|
230
|
-
* 'scope': 'your scopes',
|
|
231
238
|
* }
|
|
232
239
|
* cidaas.getRequestId(option).then(function (response) {
|
|
233
240
|
* // the response will give you request id.
|
|
@@ -237,18 +244,9 @@ class WebAuth {
|
|
|
237
244
|
* ```
|
|
238
245
|
*/
|
|
239
246
|
getRequestId(option) {
|
|
247
|
+
var _a, _b, _c, _d, _e;
|
|
240
248
|
const ui_locales = window.webAuthSettings.ui_locales;
|
|
241
|
-
const
|
|
242
|
-
const payload = option ? option : defaultPayload;
|
|
243
|
-
if (!payload.response_type) {
|
|
244
|
-
payload.response_type = 'token';
|
|
245
|
-
}
|
|
246
|
-
if (!payload.response_mode) {
|
|
247
|
-
payload.response_mode = 'fragment';
|
|
248
|
-
}
|
|
249
|
-
if (!payload.nonce) {
|
|
250
|
-
payload.nonce = new Date().getTime().toString();
|
|
251
|
-
}
|
|
249
|
+
const payload = Object.assign({ 'client_id': (_a = option === null || option === void 0 ? void 0 : option.client_id) !== null && _a !== void 0 ? _a : window.webAuthSettings.client_id, 'redirect_uri': (_b = option === null || option === void 0 ? void 0 : option.redirect_uri) !== null && _b !== void 0 ? _b : window.webAuthSettings.redirect_uri, 'response_type': (_c = option === null || option === void 0 ? void 0 : option.response_type) !== null && _c !== void 0 ? _c : (window.webAuthSettings.response_type || 'token'), 'response_mode': (_d = option === null || option === void 0 ? void 0 : option.response_mode) !== null && _d !== void 0 ? _d : (window.webAuthSettings.response_mode || 'fragment'), 'scope': (_e = option === null || option === void 0 ? void 0 : option.scope) !== null && _e !== void 0 ? _e : window.webAuthSettings.scope, 'nonce': new Date().getTime().toString() }, (ui_locales && { ui_locales } || {}));
|
|
252
250
|
const serviceURL = window.webAuthSettings.authority + '/authz-srv/authrequest/authz/generate';
|
|
253
251
|
return Helper_1.Helper.createHttpPromise(payload, serviceURL, false, "POST");
|
|
254
252
|
}
|
|
@@ -50,11 +50,11 @@ export interface UserActionOnEnrollmentRequest {
|
|
|
50
50
|
}
|
|
51
51
|
export interface GetRequestIdRequest {
|
|
52
52
|
/** Unique identifier of client app, can be found in app setting under admin ui */
|
|
53
|
-
client_id
|
|
53
|
+
client_id?: string;
|
|
54
54
|
/** Specify the url where the user needs to be redirected after successful login */
|
|
55
|
-
redirect_uri
|
|
55
|
+
redirect_uri?: string;
|
|
56
56
|
/** Permissions that are requested for this requestId */
|
|
57
|
-
scope
|
|
57
|
+
scope?: string;
|
|
58
58
|
/** Response type expected for the process e.g. token or code */
|
|
59
59
|
response_type?: string;
|
|
60
60
|
/** Response mode defines how the redirect_uri will receive the token or code e.g. as query or fragment */
|