cidaas-javascript-sdk 4.3.0 → 4.3.1

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 CHANGED
@@ -1,11 +1,35 @@
1
- # [4.3.0](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/compare/v4.2.4...v4.3.0) (2024-10-21)
1
+ ## [4.3.1](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/compare/v4.3.0...v4.3.1) (2024-11-14)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * [#434](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/issues/434) update javascript sdk redirection in documentation ([5c12adb](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/5c12adbc41f3458425e8faad3c48f6f57201be8b))
7
+ * [#438](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/issues/438) review changes ([d60d3ab](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/d60d3ab5944a14768f064ba2d852924c071faf08))
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))
2
20
 
21
+ # Changelog
3
22
 
4
- ### Features
23
+ ## V4.3.1
5
24
 
6
- * update docs ([ab57459](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/ab5745918f80f5c76f7b529b66dc8a8bae10369e))
25
+ ### Changed
26
+ - Update required functions to accept headers
27
+ - Expand resetPassword flow functions with optional handleResponseAsJson for compatibility with older cidaas version
28
+ - Define data model for getRequestId() function payload
29
+ - Expand getRequestId() function with optional payload as parameter
7
30
 
8
- # Changelog
31
+ ### Fix
32
+ - Fix redirection in readme file
9
33
 
10
34
  ## V4.3.0
11
35
 
package/README.md CHANGED
@@ -114,7 +114,7 @@ Cidaas Javascript SDK features the following functionality:
114
114
 
115
115
  #### Authentication Functions
116
116
 
117
- The SDK offers multiple way to authenticate user. Whether using browser redirection, in a pop up window, or in an iframe for silent sign in. The functions for authentication could be found [here](https://github.com/Cidaas/cidaas-javascript-sdk/blob/master/src/main/authentication/index.ts)
117
+ The SDK offers multiple way to authenticate user. Whether using browser redirection, in a pop up window, or in an iframe for silent sign in. The functions for authentication could be found [here](https://github.com/Cidaas/cidaas-javascript-sdk/blob/master/src/main/authentication/Authentication.ts)
118
118
 
119
119
  | SDK Functions | Description |
120
120
  |----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -124,7 +124,7 @@ The SDK offers multiple way to authenticate user. Whether using browser redirect
124
124
 
125
125
  #### Login Management
126
126
 
127
- The login functions could be found [here](https://github.com/Cidaas/cidaas-javascript-sdk/blob/master/src/main/web-auth/LoginService.ts). The SDK support the following login management functions:
127
+ The login functions could be found [here](https://github.com/Cidaas/cidaas-javascript-sdk/blob/master/src/main/login-service/LoginService.ts). The SDK support the following login management functions:
128
128
 
129
129
  | SDK Functions | Description |
130
130
  |----------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -136,7 +136,7 @@ The login functions could be found [here](https://github.com/Cidaas/cidaas-javas
136
136
 
137
137
  #### User Management
138
138
 
139
- The user functions could be found [here](https://github.com/Cidaas/cidaas-javascript-sdk/blob/master/src/main/web-auth/UserService.ts). The SDK support the following user management functions:
139
+ The user functions could be found [here](https://github.com/Cidaas/cidaas-javascript-sdk/blob/master/src/main/user-service/UserService.ts). The SDK support the following user management functions:
140
140
 
141
141
  | SDK Functions | Description |
142
142
  |-------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -151,7 +151,7 @@ The user functions could be found [here](https://github.com/Cidaas/cidaas-javasc
151
151
 
152
152
  #### Token Management
153
153
 
154
- The token functions could be found [here](https://github.com/Cidaas/cidaas-javascript-sdk/blob/master/src/main/web-auth/TokenService.ts). The SDK support the following token management functions:
154
+ The token functions could be found [here](https://github.com/Cidaas/cidaas-javascript-sdk/blob/master/src/main/token-service/TokenService.ts). The SDK support the following token management functions:
155
155
 
156
156
  | SDK Functions | Description |
157
157
  |--------------------------------------|-----------------------------------------------------------------------------------------------------|
@@ -163,7 +163,7 @@ The token functions could be found [here](https://github.com/Cidaas/cidaas-javas
163
163
 
164
164
  #### Verification Management
165
165
 
166
- The verification functions could be found [here](https://github.com/Cidaas/cidaas-javascript-sdk/blob/master/src/main/web-auth/VerificationService.ts). The SDK support the following verification management functions:
166
+ The verification functions could be found [here](https://github.com/Cidaas/cidaas-javascript-sdk/blob/master/src/main/verification-service/VerificationService.ts). The SDK support the following verification management functions:
167
167
 
168
168
  | SDK Functions | Description |
169
169
  |---------------------------------------------------------------------|---------------------------------------------------------------------------------------|
@@ -176,7 +176,7 @@ The verification functions could be found [here](https://github.com/Cidaas/cidaa
176
176
 
177
177
  #### Consent Management
178
178
 
179
- The consent functions could be found [here](https://github.com/Cidaas/cidaas-javascript-sdk/blob/master/src/main/web-auth/ConsentService.ts). The SDK support the following consent management functions:
179
+ The consent functions could be found [here](https://github.com/Cidaas/cidaas-javascript-sdk/blob/master/src/main/consent-service/ConsentService.ts). The SDK support the following consent management functions:
180
180
 
181
181
  | SDK Functions | Description |
182
182
  |---------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|
@@ -29,6 +29,10 @@ export interface HTTPRequestHeader {
29
29
  bot_captcha_response?: string;
30
30
  /** Identifier generated after successful authentication but unfulfilled prechecks */
31
31
  trackId?: string;
32
+ /** Latitude is the string location parameter sent in the headers */
33
+ lat?: string;
34
+ /** Longitude is the string location parameter sent in the headers */
35
+ lon?: string;
32
36
  }
33
37
  /** defines whether the the process will be done via email link or whether the user needs to enter a code to complete the process. */
34
38
  export declare enum ProcessingType {
@@ -1,3 +1,4 @@
1
+ import { HTTPRequestHeader } from "../common/Common.model";
1
2
  import { AcceptClaimConsentRequest, AcceptConsentRequest, AcceptScopeConsentRequest, GetConsentDetailsRequest, GetConsentVersionDetailsRequest, RevokeClaimConsentRequest } from "./ConsentService.model";
2
3
  /**
3
4
  * To get consent details , call **getConsentDetails()**.
@@ -17,7 +18,7 @@ import { AcceptClaimConsentRequest, AcceptConsentRequest, AcceptScopeConsentRequ
17
18
  * });
18
19
  * ```
19
20
  */
20
- export declare function getConsentDetails(options: GetConsentDetailsRequest): Promise<any>;
21
+ export declare function getConsentDetails(options: GetConsentDetailsRequest, headers?: HTTPRequestHeader): Promise<any>;
21
22
  /**
22
23
  * To accept consent, call **acceptConsent()**.
23
24
  * @example
@@ -34,7 +35,7 @@ export declare function getConsentDetails(options: GetConsentDetailsRequest): Pr
34
35
  * });
35
36
  * ```
36
37
  */
37
- export declare function acceptConsent(options: AcceptConsentRequest): Promise<any>;
38
+ export declare function acceptConsent(options: AcceptConsentRequest, headers?: HTTPRequestHeader): Promise<any>;
38
39
  /**
39
40
  * To get version details of consent, call **getConsentVersionDetails()**.
40
41
  * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/7e24ac2113315-get-consent-version-details for more details.
@@ -51,7 +52,7 @@ export declare function acceptConsent(options: AcceptConsentRequest): Promise<an
51
52
  * });
52
53
  * ```
53
54
  */
54
- export declare function getConsentVersionDetails(options: GetConsentVersionDetailsRequest): Promise<any>;
55
+ export declare function getConsentVersionDetails(options: GetConsentVersionDetailsRequest, headers?: HTTPRequestHeader): Promise<any>;
55
56
  /**
56
57
  * To accept scope consent, call **acceptScopeConsent()**.
57
58
  * @example
@@ -63,7 +64,7 @@ export declare function getConsentVersionDetails(options: GetConsentVersionDetai
63
64
  * });
64
65
  * ```
65
66
  */
66
- export declare function acceptScopeConsent(options: AcceptScopeConsentRequest): Promise<any>;
67
+ export declare function acceptScopeConsent(options: AcceptScopeConsentRequest, headers?: HTTPRequestHeader): Promise<any>;
67
68
  /**
68
69
  * To accept claim consent, call **acceptClaimConsent()**.
69
70
  * @example
@@ -75,7 +76,7 @@ export declare function acceptScopeConsent(options: AcceptScopeConsentRequest):
75
76
  * });
76
77
  * ```
77
78
  */
78
- export declare function acceptClaimConsent(options: AcceptClaimConsentRequest): Promise<any>;
79
+ export declare function acceptClaimConsent(options: AcceptClaimConsentRequest, headers?: HTTPRequestHeader): Promise<any>;
79
80
  /**
80
81
  * To revoke claim consent, call **revokeClaimConsent()**.
81
82
  * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/9ae62e98842fe-revoke-user-consent-claim for more details.
@@ -20,9 +20,9 @@ const Helper_1 = require("../common/Helper");
20
20
  * });
21
21
  * ```
22
22
  */
23
- function getConsentDetails(options) {
23
+ function getConsentDetails(options, headers) {
24
24
  const _serviceURL = window.webAuthSettings.authority + "/consent-management-srv/v2/consent/usage/public/info";
25
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST");
25
+ return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", undefined, headers);
26
26
  }
27
27
  exports.getConsentDetails = getConsentDetails;
28
28
  /**
@@ -41,9 +41,9 @@ exports.getConsentDetails = getConsentDetails;
41
41
  * });
42
42
  * ```
43
43
  */
44
- function acceptConsent(options) {
44
+ function acceptConsent(options, headers) {
45
45
  const _serviceURL = window.webAuthSettings.authority + "/consent-management-srv/v2/consent/usage/accept";
46
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST");
46
+ return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", undefined, headers);
47
47
  }
48
48
  exports.acceptConsent = acceptConsent;
49
49
  /**
@@ -62,13 +62,13 @@ exports.acceptConsent = acceptConsent;
62
62
  * });
63
63
  * ```
64
64
  */
65
- function getConsentVersionDetails(options) {
65
+ function getConsentVersionDetails(options, headers) {
66
66
  let _serviceURL = window.webAuthSettings.authority + "/consent-management-srv/v2/consent/versions/details/" + options.consentid;
67
67
  if (options.locale) {
68
68
  _serviceURL += "?locale=" + options.locale;
69
69
  }
70
70
  // BREAKING TODO: remove access token as it is not needed to get consent version details
71
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET", options.access_token);
71
+ return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET", options.access_token, headers);
72
72
  }
73
73
  exports.getConsentVersionDetails = getConsentVersionDetails;
74
74
  /**
@@ -82,9 +82,9 @@ exports.getConsentVersionDetails = getConsentVersionDetails;
82
82
  * });
83
83
  * ```
84
84
  */
85
- function acceptScopeConsent(options) {
85
+ function acceptScopeConsent(options, headers) {
86
86
  const _serviceURL = window.webAuthSettings.authority + "/consent-management-srv/consent/scope/accept";
87
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST");
87
+ return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", undefined, headers);
88
88
  }
89
89
  exports.acceptScopeConsent = acceptScopeConsent;
90
90
  /**
@@ -98,9 +98,9 @@ exports.acceptScopeConsent = acceptScopeConsent;
98
98
  * });
99
99
  * ```
100
100
  */
101
- function acceptClaimConsent(options) {
101
+ function acceptClaimConsent(options, headers) {
102
102
  const _serviceURL = window.webAuthSettings.authority + "/consent-management-srv/consent/claim/accept";
103
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST");
103
+ return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", undefined, headers);
104
104
  }
105
105
  exports.acceptClaimConsent = acceptClaimConsent;
106
106
  /**
@@ -123,6 +123,10 @@ export interface ProgressiveRegistrationHeader {
123
123
  trackId: string;
124
124
  /** Response language, which is configured in cidaas admin ui */
125
125
  acceptlanguage?: string;
126
+ /** Latitude is the string location parameter sent in the headers */
127
+ lat?: string;
128
+ /** Longitude is the string location parameter sent in the headers */
129
+ lon?: string;
126
130
  }
127
131
  export interface LoginAfterRegisterRequest {
128
132
  /** Deprecated: will be removed in the next major release */
@@ -1,5 +1,5 @@
1
1
  import { GetAccessTokenRequest, RenewTokenRequest, TokenIntrospectionRequest } from "./TokenService.model";
2
- import { LoginPrecheckRequest } from "../common/Common.model";
2
+ import { HTTPRequestHeader, LoginPrecheckRequest } from "../common/Common.model";
3
3
  /**
4
4
  * To get a new token with the grant type refresh_token, call **renewToken()**.
5
5
  * The refresh token to create a new token. The refresh token is received while creating an access token using the token endpoint and later can be used to fetch a new token without using credentials
@@ -77,7 +77,7 @@ export declare function validateAccessToken(options: TokenIntrospectionRequest):
77
77
  * });
78
78
  * ```
79
79
  */
80
- export declare function loginPrecheck(options: LoginPrecheckRequest): Promise<any>;
80
+ export declare function loginPrecheck(options: LoginPrecheckRequest, headers?: HTTPRequestHeader): Promise<any>;
81
81
  /**
82
82
  * To get the missing fields after login, call **getMissingFields()**.
83
83
  * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/aappczju1t3uh-precheck-information for more details.
@@ -93,7 +93,7 @@ export declare function loginPrecheck(options: LoginPrecheckRequest): Promise<an
93
93
  * });
94
94
  * ```
95
95
  */
96
- export declare function getMissingFields(trackId: string): Promise<any>;
96
+ export declare function getMissingFields(trackId: string, headers?: HTTPRequestHeader): Promise<any>;
97
97
  /**
98
98
  * To initiate device code, call **initiateDeviceCode()**.
99
99
  * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/b6d284f55be5e-authorization-request for more details.
@@ -123,9 +123,9 @@ exports.validateAccessToken = validateAccessToken;
123
123
  * });
124
124
  * ```
125
125
  */
126
- function loginPrecheck(options) {
126
+ function loginPrecheck(options, headers) {
127
127
  const _serviceURL = window.webAuthSettings.authority + "/token-srv/prelogin/metadata/" + options.track_id;
128
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET");
128
+ return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET", undefined, headers);
129
129
  }
130
130
  exports.loginPrecheck = loginPrecheck;
131
131
  /**
@@ -143,9 +143,9 @@ exports.loginPrecheck = loginPrecheck;
143
143
  * });
144
144
  * ```
145
145
  */
146
- function getMissingFields(trackId) {
146
+ function getMissingFields(trackId, headers) {
147
147
  const _serviceURL = window.webAuthSettings.authority + "/token-srv/prelogin/metadata/" + trackId;
148
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET");
148
+ return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET", undefined, headers);
149
149
  }
150
150
  exports.getMissingFields = getMissingFields;
151
151
  /**
@@ -65,7 +65,7 @@ export declare function register(options: RegisterRequest, headers: HTTPRequestH
65
65
  * });
66
66
  * ```
67
67
  */
68
- export declare function getInviteUserDetails(options: GetInviteUserDetailsRequest): Promise<any>;
68
+ export declare function getInviteUserDetails(options: GetInviteUserDetailsRequest, headers?: HTTPRequestHeader): Promise<any>;
69
69
  /**
70
70
  * Once registration successful, verify the account based on the flow. To get the details, call **getCommunicationStatus()**.
71
71
  * @example
@@ -97,7 +97,7 @@ export declare function getCommunicationStatus(options: getCommunicationStatusRe
97
97
  * });
98
98
  * ```
99
99
  */
100
- export declare function initiateResetPassword(options: InitiateResetPasswordRequest): Promise<any>;
100
+ export declare function initiateResetPassword(options: InitiateResetPasswordRequest, headers?: HTTPRequestHeader): Promise<any>;
101
101
  /**
102
102
  * To handle the reset password by entering the verification code you received, call **handleResetPassword()**. This will check if your verification code was valid or not, and allows you to proceed to the next step.
103
103
  * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/3t8ztokeb7cfz-handle-reset-password for more details.
@@ -114,7 +114,7 @@ export declare function initiateResetPassword(options: InitiateResetPasswordRequ
114
114
  * });
115
115
  * ```
116
116
  */
117
- export declare function handleResetPassword(options: HandleResetPasswordRequest, handleResponseAsJson?: boolean): Promise<any>;
117
+ export declare function handleResetPassword(options: HandleResetPasswordRequest, handleResponseAsJson?: boolean, headers?: HTTPRequestHeader): Promise<any>;
118
118
  /**
119
119
  * To finish reseting the password, call **resetPassword()**. This will allow you to change your password.
120
120
  * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/qa9ny0gkzlf6y-accept-reset-password for more details.
@@ -133,7 +133,7 @@ export declare function handleResetPassword(options: HandleResetPasswordRequest,
133
133
  * });
134
134
  * ```
135
135
  */
136
- export declare function resetPassword(options: ResetPasswordRequest, handleResponseAsJson?: boolean): Promise<any>;
136
+ export declare function resetPassword(options: ResetPasswordRequest, handleResponseAsJson?: boolean, headers?: HTTPRequestHeader): Promise<any>;
137
137
  /**
138
138
  * To get the list of existing users in deduplication, call **getDeduplicationDetails()**.
139
139
  * @example
@@ -147,7 +147,7 @@ export declare function resetPassword(options: ResetPasswordRequest, handleRespo
147
147
  * });
148
148
  * ```
149
149
  */
150
- export declare function getDeduplicationDetails(options: GetDeduplicationDetailsRequest): Promise<any>;
150
+ export declare function getDeduplicationDetails(options: GetDeduplicationDetailsRequest, headers?: HTTPRequestHeader): Promise<any>;
151
151
  /**
152
152
  * To use the existing users in deduplication, you need to call **deduplicationLogin()**.
153
153
  * @example
@@ -173,7 +173,7 @@ export declare function deduplicationLogin(options: DeduplicationLoginRequest):
173
173
  * });
174
174
  * ```
175
175
  */
176
- export declare function registerDeduplication(options: RegisterDeduplicationRequest): Promise<any>;
176
+ export declare function registerDeduplication(options: RegisterDeduplicationRequest, headers?: HTTPRequestHeader): Promise<any>;
177
177
  /**
178
178
  * To change the password, call **changePassword()**. This will allow you to change your password.
179
179
  * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/8221883241464-change-password for more details.
@@ -314,4 +314,4 @@ export declare function deleteUserAccount(options: DeleteUserAccountRequest): Pr
314
314
  * });
315
315
  * ```
316
316
  */
317
- export declare function userCheckExists(options: UserCheckExistsRequest): Promise<any>;
317
+ export declare function userCheckExists(options: UserCheckExistsRequest, headers?: HTTPRequestHeader): Promise<any>;
@@ -80,7 +80,7 @@ exports.register = register;
80
80
  * });
81
81
  * ```
82
82
  */
83
- function getInviteUserDetails(options) {
83
+ function getInviteUserDetails(options, headers) {
84
84
  let _serviceURL = "";
85
85
  if (options.callLatestAPI) {
86
86
  _serviceURL = window.webAuthSettings.authority + "/useractions-srv/invitations/" + options.invite_id;
@@ -88,7 +88,7 @@ function getInviteUserDetails(options) {
88
88
  else {
89
89
  _serviceURL = window.webAuthSettings.authority + "/users-srv/invite/info/" + options.invite_id;
90
90
  }
91
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET");
91
+ return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET", undefined, headers);
92
92
  }
93
93
  exports.getInviteUserDetails = getInviteUserDetails;
94
94
  /**
@@ -126,9 +126,9 @@ exports.getCommunicationStatus = getCommunicationStatus;
126
126
  * });
127
127
  * ```
128
128
  */
129
- function initiateResetPassword(options) {
129
+ function initiateResetPassword(options, headers) {
130
130
  const _serviceURL = window.webAuthSettings.authority + "/users-srv/resetpassword/initiate";
131
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST");
131
+ return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", undefined, headers);
132
132
  }
133
133
  exports.initiateResetPassword = initiateResetPassword;
134
134
  /**
@@ -147,7 +147,7 @@ exports.initiateResetPassword = initiateResetPassword;
147
147
  * });
148
148
  * ```
149
149
  */
150
- function handleResetPassword(options, handleResponseAsJson) {
150
+ function handleResetPassword(options, handleResponseAsJson, headers) {
151
151
  try {
152
152
  const url = window.webAuthSettings.authority + "/users-srv/resetpassword/validatecode";
153
153
  if (!handleResponseAsJson) {
@@ -158,7 +158,7 @@ function handleResetPassword(options, handleResponseAsJson) {
158
158
  }
159
159
  else {
160
160
  // older cidaas service handling return json object
161
- return Helper_1.Helper.createHttpPromise(options, url, false, "POST");
161
+ return Helper_1.Helper.createHttpPromise(options, url, false, "POST", undefined, headers);
162
162
  }
163
163
  }
164
164
  catch (ex) {
@@ -184,7 +184,7 @@ exports.handleResetPassword = handleResetPassword;
184
184
  * });
185
185
  * ```
186
186
  */
187
- function resetPassword(options, handleResponseAsJson) {
187
+ function resetPassword(options, handleResponseAsJson, headers) {
188
188
  const url = window.webAuthSettings.authority + "/users-srv/resetpassword/accept";
189
189
  try {
190
190
  if (!handleResponseAsJson) {
@@ -195,7 +195,7 @@ function resetPassword(options, handleResponseAsJson) {
195
195
  }
196
196
  else {
197
197
  // older cidaas service handling return json object
198
- return Helper_1.Helper.createHttpPromise(options, url, false, "POST");
198
+ return Helper_1.Helper.createHttpPromise(options, url, false, "POST", undefined, headers);
199
199
  }
200
200
  }
201
201
  catch (ex) {
@@ -216,9 +216,9 @@ exports.resetPassword = resetPassword;
216
216
  * });
217
217
  * ```
218
218
  */
219
- function getDeduplicationDetails(options) {
219
+ function getDeduplicationDetails(options, headers) {
220
220
  const _serviceURL = window.webAuthSettings.authority + "/users-srv/deduplication/info/" + options.trackId;
221
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "GET");
221
+ return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "GET", undefined, headers);
222
222
  }
223
223
  exports.getDeduplicationDetails = getDeduplicationDetails;
224
224
  /**
@@ -257,9 +257,9 @@ exports.deduplicationLogin = deduplicationLogin;
257
257
  * });
258
258
  * ```
259
259
  */
260
- function registerDeduplication(options) {
260
+ function registerDeduplication(options, headers) {
261
261
  const _serviceURL = window.webAuthSettings.authority + "/users-srv/deduplication/register/" + options.trackId;
262
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, undefined, "POST");
262
+ return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, undefined, "POST", undefined, headers);
263
263
  }
264
264
  exports.registerDeduplication = registerDeduplication;
265
265
  /**
@@ -431,7 +431,7 @@ exports.deleteUserAccount = deleteUserAccount;
431
431
  * });
432
432
  * ```
433
433
  */
434
- function userCheckExists(options) {
434
+ function userCheckExists(options, headers) {
435
435
  let queryParameter = '';
436
436
  if (options.webfinger || options.rememberMe) {
437
437
  queryParameter += '?';
@@ -446,6 +446,6 @@ function userCheckExists(options) {
446
446
  }
447
447
  }
448
448
  const _serviceURL = window.webAuthSettings.authority + "/useractions-srv/userexistence/" + options.requestId + queryParameter;
449
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
449
+ return Helper_1.Helper.createHttpPromise(options, _serviceURL, undefined, "POST", undefined, headers);
450
450
  }
451
451
  exports.userCheckExists = userCheckExists;
@@ -1,3 +1,4 @@
1
+ import { HTTPRequestHeader } from "../common/Common.model";
1
2
  import { AuthenticateMFARequest, CancelMFARequest, CheckVerificationTypeConfiguredRequest, ConfigureFriendlyNameRequest, ConfigureVerificationRequest, EnrollVerificationRequest, GetMFAListRequest, InitiateAccountVerificationRequest, InitiateEnrollmentRequest, InitiateMFARequest, InitiateVerificationRequest, VerifyAccountRequest } from "./VerificationService.model";
2
3
  /**
3
4
  * To initiate the account verification, call **initiateAccountVerification()**. This will send verification code email or sms or ivr based on the verificationMedium you mentioned.
@@ -32,7 +33,7 @@ export declare function initiateAccountVerification(options: InitiateAccountVeri
32
33
  * });
33
34
  * ```
34
35
  */
35
- export declare function verifyAccount(options: VerifyAccountRequest): Promise<any>;
36
+ export declare function verifyAccount(options: VerifyAccountRequest, headers?: HTTPRequestHeader): Promise<any>;
36
37
  /**
37
38
  * To get all configured multi factor authentication, call **getMFAList()**.
38
39
  * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/ee688a9c52b63-list-of-configured-verification-methods for more details.
@@ -48,7 +49,7 @@ export declare function verifyAccount(options: VerifyAccountRequest): Promise<an
48
49
  * });
49
50
  * ```
50
51
  */
51
- export declare function getMFAList(options: GetMFAListRequest): Promise<any>;
52
+ export declare function getMFAList(options: GetMFAListRequest, headers?: HTTPRequestHeader): Promise<any>;
52
53
  /**
53
54
  * to cancel mfa process, call **cancelMFA()**.
54
55
  * @example
@@ -64,7 +65,7 @@ export declare function getMFAList(options: GetMFAListRequest): Promise<any>;
64
65
  * });
65
66
  * ```
66
67
  */
67
- export declare function cancelMFA(options: CancelMFARequest): Promise<any>;
68
+ export declare function cancelMFA(options: CancelMFARequest, headers?: HTTPRequestHeader): Promise<any>;
68
69
  /**
69
70
  * To get list of all verification type configured, call **getAllVerificationList()**. access_token must be passed as function parameter.
70
71
  * @example
@@ -80,7 +81,7 @@ export declare function cancelMFA(options: CancelMFARequest): Promise<any>;
80
81
  * });
81
82
  * ```
82
83
  */
83
- export declare function getAllVerificationList(access_token: string): Promise<any>;
84
+ export declare function getAllVerificationList(access_token: string, headers?: HTTPRequestHeader): Promise<any>;
84
85
  /**
85
86
  * To initiate enrollment of new multi factor authentication, call **initiateEnrollment()**.
86
87
  * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/branches/master/f85aef6754714-initiate-physical-verification-setup for more details.
@@ -119,7 +120,7 @@ export declare function initiateEnrollment(options: InitiateEnrollmentRequest, a
119
120
  * });
120
121
  * ```
121
122
  */
122
- export declare function getEnrollmentStatus(status_id: string, accessToken: string): Promise<any>;
123
+ export declare function getEnrollmentStatus(status_id: string, accessToken: string, headers?: HTTPRequestHeader): Promise<any>;
123
124
  /**
124
125
  * to finish enrollment process of new multi factor authentication, call **enrollVerification()**.
125
126
  * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/branches/master/20ec76e937b27-enroll-physical-verification-setup for more details.
@@ -184,7 +185,7 @@ export declare function checkVerificationTypeConfigured(options: CheckVerificati
184
185
  * });
185
186
  * ```
186
187
  */
187
- export declare function initiateMFA(options: InitiateMFARequest, accessToken?: string): Promise<any>;
188
+ export declare function initiateMFA(options: InitiateMFARequest, accessToken?: string, headers?: HTTPRequestHeader): Promise<any>;
188
189
  /**
189
190
  * to authenticate with multi factor auhentication, call **authenticateMFA()**.
190
191
  * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/1aa38936252d6-perform-the-authentication-method for more details.
@@ -203,7 +204,7 @@ export declare function initiateMFA(options: InitiateMFARequest, accessToken?: s
203
204
  * });
204
205
  * ```
205
206
  */
206
- export declare function authenticateMFA(options: AuthenticateMFARequest): Promise<any>;
207
+ export declare function authenticateMFA(options: AuthenticateMFARequest, headers?: HTTPRequestHeader): Promise<any>;
207
208
  /**
208
209
  * to initiate verification process, call **initiateVerification**
209
210
  */
@@ -46,9 +46,9 @@ exports.initiateAccountVerification = initiateAccountVerification;
46
46
  * });
47
47
  * ```
48
48
  */
49
- function verifyAccount(options) {
49
+ function verifyAccount(options, headers) {
50
50
  const _serviceURL = window.webAuthSettings.authority + "/verification-srv/account/verify";
51
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST");
51
+ return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", undefined, headers);
52
52
  }
53
53
  exports.verifyAccount = verifyAccount;
54
54
  /**
@@ -66,9 +66,9 @@ exports.verifyAccount = verifyAccount;
66
66
  * });
67
67
  * ```
68
68
  */
69
- function getMFAList(options) {
69
+ function getMFAList(options, headers) {
70
70
  const _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/public/configured/list";
71
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST");
71
+ return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", undefined, headers);
72
72
  }
73
73
  exports.getMFAList = getMFAList;
74
74
  /**
@@ -86,9 +86,9 @@ exports.getMFAList = getMFAList;
86
86
  * });
87
87
  * ```
88
88
  */
89
- function cancelMFA(options) {
89
+ function cancelMFA(options, headers) {
90
90
  const _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/authenticate/cancel/" + options.type;
91
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
91
+ return Helper_1.Helper.createHttpPromise(options, _serviceURL, undefined, "POST", undefined, headers);
92
92
  }
93
93
  exports.cancelMFA = cancelMFA;
94
94
  /**
@@ -106,9 +106,9 @@ exports.cancelMFA = cancelMFA;
106
106
  * });
107
107
  * ```
108
108
  */
109
- function getAllVerificationList(access_token) {
109
+ function getAllVerificationList(access_token, headers) {
110
110
  const _serviceURL = `${window.webAuthSettings.authority}/verification-srv/config/list`;
111
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, undefined, "GET", access_token);
111
+ return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, undefined, "GET", access_token, headers);
112
112
  }
113
113
  exports.getAllVerificationList = getAllVerificationList;
114
114
  /**
@@ -153,9 +153,9 @@ exports.initiateEnrollment = initiateEnrollment;
153
153
  * });
154
154
  * ```
155
155
  */
156
- function getEnrollmentStatus(status_id, accessToken) {
156
+ function getEnrollmentStatus(status_id, accessToken, headers) {
157
157
  const _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/notification/status/" + status_id;
158
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, undefined, "POST", accessToken);
158
+ return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, undefined, "POST", accessToken, headers);
159
159
  }
160
160
  exports.getEnrollmentStatus = getEnrollmentStatus;
161
161
  /**
@@ -230,13 +230,13 @@ exports.checkVerificationTypeConfigured = checkVerificationTypeConfigured;
230
230
  * });
231
231
  * ```
232
232
  */
233
- function initiateMFA(options, accessToken) {
233
+ function initiateMFA(options, accessToken, headers) {
234
234
  const _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/authenticate/initiate/" + options.type;
235
235
  // BREAKING TODO: remove accessToken parameter in the next major release
236
236
  if (accessToken) {
237
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", accessToken);
237
+ return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", accessToken, headers);
238
238
  }
239
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST");
239
+ return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", undefined, headers);
240
240
  }
241
241
  exports.initiateMFA = initiateMFA;
242
242
  /**
@@ -257,9 +257,9 @@ exports.initiateMFA = initiateMFA;
257
257
  * });
258
258
  * ```
259
259
  */
260
- function authenticateMFA(options) {
260
+ function authenticateMFA(options, headers) {
261
261
  const _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/authenticate/authenticate/" + options.type;
262
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
262
+ return Helper_1.Helper.createHttpPromise(options, _serviceURL, undefined, "POST", undefined, headers);
263
263
  }
264
264
  exports.authenticateMFA = authenticateMFA;
265
265
  /**
@@ -8,7 +8,7 @@ import { HTTPRequestHeader } from "../common/Common.model";
8
8
  import { User } from "oidc-client-ts";
9
9
  import { OidcSettings, LoginRedirectOptions, PopupSignInOptions, SilentSignInOptions, LogoutRedirectOptions, PopupSignOutOptions, LogoutResponse, LoginRequestOptions } from "../authentication/Authentication.model";
10
10
  import { AuthenticateMFARequest, CancelMFARequest, CheckVerificationTypeConfiguredRequest, ConfigureFriendlyNameRequest, ConfigureVerificationRequest, EnrollVerificationRequest, GetMFAListRequest, InitiateAccountVerificationRequest, InitiateEnrollmentRequest, InitiateMFARequest, InitiateVerificationRequest, VerifyAccountRequest } from "../verification-service/VerificationService.model";
11
- import { DeleteDeviceRequest, GetClientInfoRequest, GetRegistrationSetupRequest, GetUserActivitiesRequest, LogoutUserRequest, UpdateProfileImageRequest, UserActionOnEnrollmentRequest } from "./webauth.model";
11
+ import { DeleteDeviceRequest, GetClientInfoRequest, GetRegistrationSetupRequest, GetUserActivitiesRequest, LogoutUserRequest, UpdateProfileImageRequest, UserActionOnEnrollmentRequest, GetRequestIdRequest } from "./webauth.model";
12
12
  export declare const createPreloginWebauth: (authority: string) => WebAuth;
13
13
  export declare class WebAuth {
14
14
  constructor(settings: OidcSettings);
@@ -114,14 +114,19 @@ 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
- * cidaas.getRequestId().then(function (response) {
117
+ * const option: GetRequestIdRequest = {
118
+ * 'client_id': 'your client id',
119
+ * 'redirect_uri': 'your redirect url',
120
+ * 'scope': 'your scopes',
121
+ * }
122
+ * cidaas.getRequestId(option).then(function (response) {
118
123
  * // the response will give you request id.
119
124
  * }).catch(function(ex) {
120
125
  * // your failure code here
121
126
  * });
122
127
  * ```
123
128
  */
124
- getRequestId(): Promise<any>;
129
+ getRequestId(option?: GetRequestIdRequest): Promise<any>;
125
130
  /**
126
131
  * To get the tenant basic information, call **getTenantInfo()**. This will return the basic tenant details such as tenant name and allowed login with types (Email, Mobile, Username).
127
132
  * @example
@@ -272,12 +277,14 @@ export declare class WebAuth {
272
277
  /**
273
278
  * get invite info
274
279
  * @param options
280
+ * @param headers
275
281
  * @returns
276
282
  */
277
- getInviteUserDetails(options: GetInviteUserDetailsRequest): Promise<any>;
283
+ getInviteUserDetails(options: GetInviteUserDetailsRequest, headers?: HTTPRequestHeader): Promise<any>;
278
284
  /**
279
285
  * get Communication status
280
286
  * @param options
287
+ * @param headers
281
288
  * @returns
282
289
  */
283
290
  getCommunicationStatus(options: getCommunicationStatusRequest, headers?: HTTPRequestHeader): Promise<any>;
@@ -290,37 +297,45 @@ export declare class WebAuth {
290
297
  /**
291
298
  * verify account
292
299
  * @param options
300
+ * @param headers
293
301
  * @returns
294
302
  */
295
- verifyAccount(options: VerifyAccountRequest): Promise<any>;
303
+ verifyAccount(options: VerifyAccountRequest, headers?: HTTPRequestHeader): Promise<any>;
296
304
  /**
297
305
  * initiate reset password
298
306
  * @param options
307
+ * @param headers
299
308
  * @returns
300
309
  */
301
- initiateResetPassword(options: InitiateResetPasswordRequest): Promise<any>;
310
+ initiateResetPassword(options: InitiateResetPasswordRequest, headers?: HTTPRequestHeader): Promise<any>;
302
311
  /**
303
312
  * handle reset password
304
313
  * @param options
314
+ * @param handleResponseAsJson
315
+ * @param headers
305
316
  */
306
- handleResetPassword(options: HandleResetPasswordRequest): Promise<any>;
317
+ handleResetPassword(options: HandleResetPasswordRequest, handleResponseAsJson?: boolean, headers?: HTTPRequestHeader): Promise<any>;
307
318
  /**
308
319
  * reset password
309
320
  * @param options
321
+ * @param handleResponseAsJson
322
+ * @param headers
310
323
  */
311
- resetPassword(options: ResetPasswordRequest): Promise<any>;
324
+ resetPassword(options: ResetPasswordRequest, handleResponseAsJson?: boolean, headers?: HTTPRequestHeader): Promise<any>;
312
325
  /**
313
326
  * get mfa list
314
327
  * @param options
328
+ * @param headers
315
329
  * @returns
316
330
  */
317
- getMFAList(options: GetMFAListRequest): Promise<any>;
331
+ getMFAList(options: GetMFAListRequest, headers?: HTTPRequestHeader): Promise<any>;
318
332
  /**
319
333
  * cancel mfa
320
334
  * @param options
335
+ * @param headers
321
336
  * @returns
322
337
  */
323
- cancelMFA(options: CancelMFARequest): Promise<any>;
338
+ cancelMFA(options: CancelMFARequest, headers?: HTTPRequestHeader): Promise<any>;
324
339
  /**
325
340
  * passwordless login
326
341
  * @param options
@@ -331,37 +346,42 @@ export declare class WebAuth {
331
346
  * @param options
332
347
  * @returns
333
348
  */
334
- getConsentDetails(options: GetConsentDetailsRequest): Promise<any>;
349
+ getConsentDetails(options: GetConsentDetailsRequest, headers?: HTTPRequestHeader): Promise<any>;
335
350
  /**
336
351
  * accept consent
337
352
  * @param options
353
+ * @param headers
338
354
  * @returns
339
355
  */
340
- acceptConsent(options: AcceptConsentRequest): Promise<any>;
356
+ acceptConsent(options: AcceptConsentRequest, headers?: HTTPRequestHeader): Promise<any>;
341
357
  /**
342
358
  * get scope consent details
343
359
  * @param options
360
+ * @param headers
344
361
  * @returns
345
362
  */
346
- loginPrecheck(options: LoginPrecheckRequest): Promise<any>;
363
+ loginPrecheck(options: LoginPrecheckRequest, headers?: HTTPRequestHeader): Promise<any>;
347
364
  /**
348
365
  * get scope consent version details
349
366
  * @param options
367
+ * @param headers
350
368
  * @returns
351
369
  */
352
- getConsentVersionDetails(options: GetConsentVersionDetailsRequest): Promise<any>;
370
+ getConsentVersionDetails(options: GetConsentVersionDetailsRequest, headers?: HTTPRequestHeader): Promise<any>;
353
371
  /**
354
372
  * accept scope Consent
355
373
  * @param options
374
+ * @param headers
356
375
  * @returns
357
376
  */
358
- acceptScopeConsent(options: AcceptScopeConsentRequest): Promise<any>;
377
+ acceptScopeConsent(options: AcceptScopeConsentRequest, headers?: HTTPRequestHeader): Promise<any>;
359
378
  /**
360
379
  * accept claim Consent
361
380
  * @param options
381
+ * @param headers
362
382
  * @returns
363
383
  */
364
- acceptClaimConsent(options: AcceptClaimConsentRequest): Promise<any>;
384
+ acceptClaimConsent(options: AcceptClaimConsentRequest, headers?: HTTPRequestHeader): Promise<any>;
365
385
  /**
366
386
  * revoke claim Consent
367
387
  * @param options
@@ -371,9 +391,10 @@ export declare class WebAuth {
371
391
  /**
372
392
  * get Deduplication details
373
393
  * @param options
394
+ * @param headers
374
395
  * @returns
375
396
  */
376
- getDeduplicationDetails(options: GetDeduplicationDetailsRequest): Promise<any>;
397
+ getDeduplicationDetails(options: GetDeduplicationDetailsRequest, headers?: HTTPRequestHeader): Promise<any>;
377
398
  /**
378
399
  * deduplication login
379
400
  * @param options
@@ -382,9 +403,10 @@ export declare class WebAuth {
382
403
  /**
383
404
  * register Deduplication
384
405
  * @param options
406
+ * @param headers
385
407
  * @returns
386
408
  */
387
- registerDeduplication(options: RegisterDeduplicationRequest): Promise<any>;
409
+ registerDeduplication(options: RegisterDeduplicationRequest, headers?: HTTPRequestHeader): Promise<any>;
388
410
  /**
389
411
  * consent continue login
390
412
  * @param options
@@ -451,9 +473,10 @@ export declare class WebAuth {
451
473
  userActionOnEnrollment(options: UserActionOnEnrollmentRequest, trackId: string): Promise<any>;
452
474
  /**
453
475
  * @param access_token
476
+ * @param headers
454
477
  * @returns
455
478
  */
456
- getAllVerificationList(access_token: string): Promise<any>;
479
+ getAllVerificationList(access_token: string, headers?: HTTPRequestHeader): Promise<any>;
457
480
  /**
458
481
  * initiate link accoount
459
482
  * @param options
@@ -509,9 +532,10 @@ export declare class WebAuth {
509
532
  /**
510
533
  * update the status of notification
511
534
  * @param status_id
535
+ * @param headers
512
536
  * @returns
513
537
  */
514
- getEnrollmentStatus(status_id: string, accessToken: string): Promise<any>;
538
+ getEnrollmentStatus(status_id: string, accessToken: string, headers?: HTTPRequestHeader): Promise<any>;
515
539
  /**
516
540
  * enrollVerification
517
541
  * @param options
@@ -551,7 +575,7 @@ export declare class WebAuth {
551
575
  */
552
576
  getMissingFields(trackId: string, useSocialProvider?: {
553
577
  requestId: string;
554
- }): Promise<any>;
578
+ }, headers?: HTTPRequestHeader): Promise<any>;
555
579
  /**
556
580
  * progressiveRegistration
557
581
  * @param options
@@ -576,9 +600,10 @@ export declare class WebAuth {
576
600
  /**
577
601
  * check if an user exists
578
602
  * @param options
603
+ * @param headers
579
604
  * @returns
580
605
  */
581
- userCheckExists(options: UserCheckExistsRequest): Promise<any>;
606
+ userCheckExists(options: UserCheckExistsRequest, headers?: HTTPRequestHeader): Promise<any>;
582
607
  /**
583
608
  * To set accept language
584
609
  * @param acceptLanguage
@@ -587,15 +612,17 @@ export declare class WebAuth {
587
612
  /**
588
613
  * initiate mfa
589
614
  * @param options
615
+ * @param headers
590
616
  * @returns
591
617
  */
592
- initiateMFA(options: InitiateMFARequest, accessToken?: string): Promise<any>;
618
+ initiateMFA(options: InitiateMFARequest, accessToken?: string, headers?: HTTPRequestHeader): Promise<any>;
593
619
  /**
594
620
  * authenticate mfa
595
621
  * @param options
622
+ * @param headers
596
623
  * @returns
597
624
  */
598
- authenticateMFA(options: AuthenticateMFARequest): Promise<any>;
625
+ authenticateMFA(options: AuthenticateMFARequest, headers?: HTTPRequestHeader): Promise<any>;
599
626
  /**
600
627
  * initiate verification
601
628
  * @param options
@@ -224,19 +224,33 @@ 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
- * cidaas.getRequestId().then(function (response) {
227
+ * const option: GetRequestIdRequest = {
228
+ * 'client_id': 'your client id',
229
+ * 'redirect_uri': 'your redirect url',
230
+ * 'scope': 'your scopes',
231
+ * }
232
+ * cidaas.getRequestId(option).then(function (response) {
228
233
  * // the response will give you request id.
229
234
  * }).catch(function(ex) {
230
235
  * // your failure code here
231
236
  * });
232
237
  * ```
233
238
  */
234
- getRequestId() {
235
- var _a, _b;
239
+ getRequestId(option) {
236
240
  const ui_locales = window.webAuthSettings.ui_locales;
237
- const options = Object.assign({ 'client_id': window.webAuthSettings.client_id, 'redirect_uri': window.webAuthSettings.redirect_uri, 'response_type': (_a = window.webAuthSettings.response_type) !== null && _a !== void 0 ? _a : 'token', "response_mode": (_b = window.webAuthSettings.response_mode) !== null && _b !== void 0 ? _b : 'fragment', "scope": window.webAuthSettings.scope, "nonce": new Date().getTime().toString() }, (ui_locales && { ui_locales } || {}));
241
+ const defaultPayload = Object.assign({ 'client_id': window.webAuthSettings.client_id, 'redirect_uri': window.webAuthSettings.redirect_uri, 'response_type': window.webAuthSettings.response_type, 'response_mode': window.webAuthSettings.response_mode, 'scope': window.webAuthSettings.scope }, (ui_locales && { ui_locales } || {}));
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
+ }
238
252
  const serviceURL = window.webAuthSettings.authority + '/authz-srv/authrequest/authz/generate';
239
- return Helper_1.Helper.createHttpPromise(options, serviceURL, false, "POST");
253
+ return Helper_1.Helper.createHttpPromise(payload, serviceURL, false, "POST");
240
254
  }
241
255
  /**
242
256
  * To get the tenant basic information, call **getTenantInfo()**. This will return the basic tenant details such as tenant name and allowed login with types (Email, Mobile, Username).
@@ -435,14 +449,16 @@ class WebAuth {
435
449
  /**
436
450
  * get invite info
437
451
  * @param options
452
+ * @param headers
438
453
  * @returns
439
454
  */
440
- getInviteUserDetails(options) {
441
- return UserService.getInviteUserDetails(options);
455
+ getInviteUserDetails(options, headers) {
456
+ return UserService.getInviteUserDetails(options, headers);
442
457
  }
443
458
  /**
444
459
  * get Communication status
445
460
  * @param options
461
+ * @param headers
446
462
  * @returns
447
463
  */
448
464
  getCommunicationStatus(options, headers) {
@@ -459,48 +475,56 @@ class WebAuth {
459
475
  /**
460
476
  * verify account
461
477
  * @param options
478
+ * @param headers
462
479
  * @returns
463
480
  */
464
- verifyAccount(options) {
465
- return VerificationService.verifyAccount(options);
481
+ verifyAccount(options, headers) {
482
+ return VerificationService.verifyAccount(options, headers);
466
483
  }
467
484
  /**
468
485
  * initiate reset password
469
486
  * @param options
487
+ * @param headers
470
488
  * @returns
471
489
  */
472
- initiateResetPassword(options) {
473
- return UserService.initiateResetPassword(options);
490
+ initiateResetPassword(options, headers) {
491
+ return UserService.initiateResetPassword(options, headers);
474
492
  }
475
493
  /**
476
494
  * handle reset password
477
495
  * @param options
496
+ * @param handleResponseAsJson
497
+ * @param headers
478
498
  */
479
- handleResetPassword(options) {
480
- return UserService.handleResetPassword(options);
499
+ handleResetPassword(options, handleResponseAsJson, headers) {
500
+ return UserService.handleResetPassword(options, handleResponseAsJson, headers);
481
501
  }
482
502
  /**
483
503
  * reset password
484
504
  * @param options
505
+ * @param handleResponseAsJson
506
+ * @param headers
485
507
  */
486
- resetPassword(options) {
487
- return UserService.resetPassword(options);
508
+ resetPassword(options, handleResponseAsJson, headers) {
509
+ return UserService.resetPassword(options, handleResponseAsJson, headers);
488
510
  }
489
511
  /**
490
512
  * get mfa list
491
513
  * @param options
514
+ * @param headers
492
515
  * @returns
493
516
  */
494
- getMFAList(options) {
495
- return VerificationService.getMFAList(options);
517
+ getMFAList(options, headers) {
518
+ return VerificationService.getMFAList(options, headers);
496
519
  }
497
520
  /**
498
521
  * cancel mfa
499
522
  * @param options
523
+ * @param headers
500
524
  * @returns
501
525
  */
502
- cancelMFA(options) {
503
- return VerificationService.cancelMFA(options);
526
+ cancelMFA(options, headers) {
527
+ return VerificationService.cancelMFA(options, headers);
504
528
  }
505
529
  /**
506
530
  * passwordless login
@@ -514,48 +538,53 @@ class WebAuth {
514
538
  * @param options
515
539
  * @returns
516
540
  */
517
- getConsentDetails(options) {
518
- return ConsentService.getConsentDetails(options);
541
+ getConsentDetails(options, headers) {
542
+ return ConsentService.getConsentDetails(options, headers);
519
543
  }
520
544
  /**
521
545
  * accept consent
522
546
  * @param options
547
+ * @param headers
523
548
  * @returns
524
549
  */
525
- acceptConsent(options) {
526
- return ConsentService.acceptConsent(options);
550
+ acceptConsent(options, headers) {
551
+ return ConsentService.acceptConsent(options, headers);
527
552
  }
528
553
  /**
529
554
  * get scope consent details
530
555
  * @param options
556
+ * @param headers
531
557
  * @returns
532
558
  */
533
- loginPrecheck(options) {
534
- return TokenService.loginPrecheck(options);
559
+ loginPrecheck(options, headers) {
560
+ return TokenService.loginPrecheck(options, headers);
535
561
  }
536
562
  /**
537
563
  * get scope consent version details
538
564
  * @param options
565
+ * @param headers
539
566
  * @returns
540
567
  */
541
- getConsentVersionDetails(options) {
542
- return ConsentService.getConsentVersionDetails(options);
568
+ getConsentVersionDetails(options, headers) {
569
+ return ConsentService.getConsentVersionDetails(options, headers);
543
570
  }
544
571
  /**
545
572
  * accept scope Consent
546
573
  * @param options
574
+ * @param headers
547
575
  * @returns
548
576
  */
549
- acceptScopeConsent(options) {
550
- return ConsentService.acceptScopeConsent(options);
577
+ acceptScopeConsent(options, headers) {
578
+ return ConsentService.acceptScopeConsent(options, headers);
551
579
  }
552
580
  /**
553
581
  * accept claim Consent
554
582
  * @param options
583
+ * @param headers
555
584
  * @returns
556
585
  */
557
- acceptClaimConsent(options) {
558
- return ConsentService.acceptClaimConsent(options);
586
+ acceptClaimConsent(options, headers) {
587
+ return ConsentService.acceptClaimConsent(options, headers);
559
588
  }
560
589
  /**
561
590
  * revoke claim Consent
@@ -568,10 +597,11 @@ class WebAuth {
568
597
  /**
569
598
  * get Deduplication details
570
599
  * @param options
600
+ * @param headers
571
601
  * @returns
572
602
  */
573
- getDeduplicationDetails(options) {
574
- return UserService.getDeduplicationDetails(options);
603
+ getDeduplicationDetails(options, headers) {
604
+ return UserService.getDeduplicationDetails(options, headers);
575
605
  }
576
606
  /**
577
607
  * deduplication login
@@ -583,10 +613,11 @@ class WebAuth {
583
613
  /**
584
614
  * register Deduplication
585
615
  * @param options
616
+ * @param headers
586
617
  * @returns
587
618
  */
588
- registerDeduplication(options) {
589
- return UserService.registerDeduplication(options);
619
+ registerDeduplication(options, headers) {
620
+ return UserService.registerDeduplication(options, headers);
590
621
  }
591
622
  /**
592
623
  * consent continue login
@@ -670,10 +701,11 @@ class WebAuth {
670
701
  }
671
702
  /**
672
703
  * @param access_token
704
+ * @param headers
673
705
  * @returns
674
706
  */
675
- getAllVerificationList(access_token) {
676
- return VerificationService.getAllVerificationList(access_token);
707
+ getAllVerificationList(access_token, headers) {
708
+ return VerificationService.getAllVerificationList(access_token, headers);
677
709
  }
678
710
  /**
679
711
  * initiate link accoount
@@ -758,10 +790,11 @@ class WebAuth {
758
790
  /**
759
791
  * update the status of notification
760
792
  * @param status_id
793
+ * @param headers
761
794
  * @returns
762
795
  */
763
- getEnrollmentStatus(status_id, accessToken) {
764
- return VerificationService.getEnrollmentStatus(status_id, accessToken);
796
+ getEnrollmentStatus(status_id, accessToken, headers) {
797
+ return VerificationService.getEnrollmentStatus(status_id, accessToken, headers);
765
798
  }
766
799
  /**
767
800
  * enrollVerification
@@ -806,13 +839,13 @@ class WebAuth {
806
839
  * ```
807
840
  *
808
841
  */
809
- getMissingFields(trackId, useSocialProvider) {
842
+ getMissingFields(trackId, useSocialProvider, headers) {
810
843
  if (useSocialProvider) {
811
844
  const _serviceURL = window.webAuthSettings.authority + "/public-srv/public/trackinfo/" + useSocialProvider.requestId + "/" + trackId;
812
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET");
845
+ return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET", undefined, headers);
813
846
  }
814
847
  else {
815
- return TokenService.getMissingFields(trackId);
848
+ return TokenService.getMissingFields(trackId, headers);
816
849
  }
817
850
  }
818
851
  /**
@@ -847,10 +880,11 @@ class WebAuth {
847
880
  /**
848
881
  * check if an user exists
849
882
  * @param options
883
+ * @param headers
850
884
  * @returns
851
885
  */
852
- userCheckExists(options) {
853
- return UserService.userCheckExists(options);
886
+ userCheckExists(options, headers) {
887
+ return UserService.userCheckExists(options, headers);
854
888
  }
855
889
  /**
856
890
  * To set accept language
@@ -862,22 +896,24 @@ class WebAuth {
862
896
  /**
863
897
  * initiate mfa
864
898
  * @param options
899
+ * @param headers
865
900
  * @returns
866
901
  */
867
- initiateMFA(options, accessToken) {
902
+ initiateMFA(options, accessToken, headers) {
868
903
  // BREAKING TODO: remove accessToken parameter in the next major release
869
904
  if (accessToken) {
870
- return VerificationService.initiateMFA(options, accessToken);
905
+ return VerificationService.initiateMFA(options, accessToken, headers);
871
906
  }
872
- return VerificationService.initiateMFA(options);
907
+ return VerificationService.initiateMFA(options, undefined, headers);
873
908
  }
874
909
  /**
875
910
  * authenticate mfa
876
911
  * @param options
912
+ * @param headers
877
913
  * @returns
878
914
  */
879
- authenticateMFA(options) {
880
- return VerificationService.authenticateMFA(options);
915
+ authenticateMFA(options, headers) {
916
+ return VerificationService.authenticateMFA(options, headers);
881
917
  }
882
918
  /**
883
919
  * initiate verification
@@ -48,3 +48,19 @@ export interface UserActionOnEnrollmentRequest {
48
48
  /** action to be executed */
49
49
  action: string;
50
50
  }
51
+ export interface GetRequestIdRequest {
52
+ /** Unique identifier of client app, can be found in app setting under admin ui */
53
+ client_id: string;
54
+ /** Specify the url where the user needs to be redirected after successful login */
55
+ redirect_uri: string;
56
+ /** Permissions that are requested for this requestId */
57
+ scope: string;
58
+ /** Response type expected for the process e.g. token or code */
59
+ response_type?: string;
60
+ /** Response mode defines how the redirect_uri will receive the token or code e.g. as query or fragment */
61
+ response_mode?: string;
62
+ /** String value used to associate a client session with an id token, and to mitigate replay attacks */
63
+ nonce?: string;
64
+ /** Preferred locale of the user */
65
+ ui_locales?: string;
66
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cidaas-javascript-sdk",
3
- "version": "4.3.0",
3
+ "version": "4.3.1",
4
4
  "author": "cidaas by Widas ID GmbH",
5
5
  "description": "Cidaas native javascript sdk",
6
6
  "license": "MIT",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@toolz/is-a-regular-object": "^1.0.1",
30
- "oidc-client-ts": "^2.4.0"
30
+ "oidc-client-ts": "^2.4.1"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@babel/core": "^7.22.9",