cidaas-javascript-sdk 4.0.0 → 4.0.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 +11 -28
- package/README.md +4 -5
- package/dist/authentication/index.js +2 -0
- package/dist/web-auth/VerificationService.d.ts +1 -1
- package/dist/web-auth/VerificationService.js +5 -1
- package/dist/web-auth/WebAuth.d.ts +1 -1
- package/dist/web-auth/WebAuth.js +12 -13
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,40 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
## [4.0.2](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/compare/v4.0.1...v4.0.2) (2024-01-18)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Bug Fixes
|
|
5
5
|
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* updated the testcases, docs in ts and removed the docs from readme ([bc59f82](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/bc59f82e43ee5fe8925d0539dd1661a1e752dda6))
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* feat()!: upgrade to v4 ([041b774](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/041b774095a6139f344c32abdec42d7d1be77610))
|
|
6
|
+
* add error handling ([08017e3](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/08017e3d1da09186f2a4f3bd4b11e606bbeb3043))
|
|
7
|
+
* empty commit for release ([b73a4f8](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/b73a4f859d3d2044db883e0d096f0037c76bc6be))
|
|
8
|
+
* remove repository from package.json ([4a15688](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/4a15688f8355411049b4f2e63db7737daafd4c7f))
|
|
13
9
|
|
|
10
|
+
# Changelog
|
|
14
11
|
|
|
15
|
-
|
|
12
|
+
## V4.0.2
|
|
16
13
|
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
- **Breaking** popup & silent authentication functions is directly implemented in WebAuth instead of using mode.
|
|
20
|
-
- **Breaking** silentSignIn is now returning promise
|
|
21
|
-
- **Breaking** getLoginURL() function return promise instead of string
|
|
22
|
-
- **Breaking** access_token option should be provided to revokeClaimConsent() function in consent service
|
|
23
|
-
- **Breaking** use function parameter instead of cidaas configuration file: `cidaas_version` to handle resetPassword
|
|
24
|
-
- **Breaking** change getCommunicationStatus parameter
|
|
25
|
-
- **Breaking** rename functions with version name
|
|
26
|
-
- **Breaking** rename getScopeConsentVersionDetails() function to getConsentVersionDetails()
|
|
27
|
-
- **Breaking** rename updateStatus() function to getEnrollmentStatus()
|
|
28
|
-
- **Breaking** rename getDeviceInfo() function to createDeviceInfo()
|
|
29
|
-
- **Breaking** rename getScopeConsentDetails() function to loginPrecheck()
|
|
30
|
-
- **Breaking** getMissingFieldsLogin() is now reimplemented as getMissingFields()
|
|
14
|
+
### Fixed
|
|
15
|
+
- fix missing error handling in loginCallback() function
|
|
31
16
|
|
|
32
|
-
|
|
33
|
-
- **Breaking** remove deprecated functions
|
|
34
|
-
- **Breaking** remove duplicate functions
|
|
35
|
-
- **Breaking** remove functions which are not supported anymore
|
|
17
|
+
## V4.0.1
|
|
36
18
|
|
|
37
|
-
|
|
19
|
+
### Changed
|
|
20
|
+
- initiateMFA() function will no longer require accessToken as parameter
|
|
38
21
|
|
|
39
22
|
## V4.0.0
|
|
40
23
|
|
package/README.md
CHANGED
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
|
|
16
16
|
This cidaas Javascript SDK library is built on the top of [OIDC client typescript library](https://github.com/authts/oidc-client-ts).
|
|
17
17
|
|
|
18
|
+
Please check the [Changelog](https://github.com/Cidaas/cidaas-sdk-javascript-v2/blob/master/CHANGELOG.md) for more information about the latest release.
|
|
19
|
+
|
|
18
20
|
## Table of Contents
|
|
19
21
|
|
|
20
22
|
<!--ts-->
|
|
@@ -48,8 +50,6 @@ From npm
|
|
|
48
50
|
npm install cidaas-javascript-sdk
|
|
49
51
|
```
|
|
50
52
|
|
|
51
|
-
Please check the [Changelog](https://github.com/Cidaas/cidaas-sdk-javascript-v2/blob/master/CHANGELOG.md) for more information about the latest release
|
|
52
|
-
|
|
53
53
|
### Initialisation
|
|
54
54
|
|
|
55
55
|
After adding the sdk library, create a local file such as **cidaas.service.ts** and define Cidaas options variable there for initializing cidaas sdk.
|
|
@@ -64,7 +64,7 @@ Cidaas options variable support every [OIDC Client UserManagerSettings Propertie
|
|
|
64
64
|
| post_logout_redirect_uri | no | URL to be redirected after successful logout attempt. |
|
|
65
65
|
| scope | no | the scope the application requires and requests from cidaas. The default value is 'openid' if no properties is being sent. |
|
|
66
66
|
|
|
67
|
-
an example of
|
|
67
|
+
an example of Cidaas options variable looks like this:
|
|
68
68
|
|
|
69
69
|
```js
|
|
70
70
|
const options = {
|
|
@@ -200,5 +200,4 @@ The SDK will throws Custom Exception if something went wrong during the operatio
|
|
|
200
200
|
| HTTP Status Code | When could it be thrown |
|
|
201
201
|
|----------------- | ----------------------- |
|
|
202
202
|
| 500 | during creation of WebAuth instance |
|
|
203
|
-
| 417 | if there are any other failure |
|
|
204
|
-
|
|
203
|
+
| 417 | if there are any other failure |
|
|
@@ -201,7 +201,7 @@ export declare namespace VerificationService {
|
|
|
201
201
|
* });
|
|
202
202
|
* ```
|
|
203
203
|
*/
|
|
204
|
-
function initiateMFA(options: IInitVerificationAuthenticationRequestEntity, accessToken
|
|
204
|
+
function initiateMFA(options: IInitVerificationAuthenticationRequestEntity, accessToken?: string): Promise<unknown>;
|
|
205
205
|
/**
|
|
206
206
|
* to authenticate with multi factor auhentication, call **authenticateMFA()**.
|
|
207
207
|
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/1aa38936252d6-perform-the-authentication-method for more details.
|
|
@@ -243,7 +243,11 @@ var VerificationService;
|
|
|
243
243
|
*/
|
|
244
244
|
function initiateMFA(options, accessToken) {
|
|
245
245
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/authenticate/initiate/" + options.type;
|
|
246
|
-
|
|
246
|
+
// TODO: remove accessToken parameter in the next major release
|
|
247
|
+
if (accessToken) {
|
|
248
|
+
return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", accessToken);
|
|
249
|
+
}
|
|
250
|
+
return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST");
|
|
247
251
|
}
|
|
248
252
|
VerificationService.initiateMFA = initiateMFA;
|
|
249
253
|
;
|
|
@@ -629,7 +629,7 @@ export declare class WebAuth {
|
|
|
629
629
|
* @param options
|
|
630
630
|
* @returns
|
|
631
631
|
*/
|
|
632
|
-
initiateMFA(options: IInitVerificationAuthenticationRequestEntity, accessToken
|
|
632
|
+
initiateMFA(options: IInitVerificationAuthenticationRequestEntity, accessToken?: string): Promise<unknown>;
|
|
633
633
|
/**
|
|
634
634
|
* authenticate mfa
|
|
635
635
|
* @param options
|
package/dist/web-auth/WebAuth.js
CHANGED
|
@@ -151,19 +151,14 @@ var WebAuth = /** @class */ (function () {
|
|
|
151
151
|
*/
|
|
152
152
|
WebAuth.prototype.loginCallback = function () {
|
|
153
153
|
return new Promise(function (resolve, reject) {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
throw new Helper_1.CustomException("Settings or Authentication instance in OIDC cannot be empty", 417);
|
|
157
|
-
}
|
|
158
|
-
window.authentication.loginCallback().then(function (user) {
|
|
159
|
-
resolve(user);
|
|
160
|
-
})["catch"](function (ex) {
|
|
161
|
-
reject(ex);
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
catch (ex) {
|
|
165
|
-
console.log(ex);
|
|
154
|
+
if (!window.webAuthSettings && !window.authentication) {
|
|
155
|
+
throw new Helper_1.CustomException("Settings or Authentication instance in OIDC cannot be empty", 417);
|
|
166
156
|
}
|
|
157
|
+
window.authentication.loginCallback().then(function (user) {
|
|
158
|
+
resolve(user);
|
|
159
|
+
})["catch"](function (ex) {
|
|
160
|
+
reject(ex);
|
|
161
|
+
});
|
|
167
162
|
});
|
|
168
163
|
};
|
|
169
164
|
;
|
|
@@ -1007,7 +1002,11 @@ var WebAuth = /** @class */ (function () {
|
|
|
1007
1002
|
* @returns
|
|
1008
1003
|
*/
|
|
1009
1004
|
WebAuth.prototype.initiateMFA = function (options, accessToken) {
|
|
1010
|
-
|
|
1005
|
+
// TODO: remove accessToken parameter in the next major release
|
|
1006
|
+
if (accessToken) {
|
|
1007
|
+
return VerificationService_1.VerificationService.initiateMFA(options, accessToken);
|
|
1008
|
+
}
|
|
1009
|
+
return VerificationService_1.VerificationService.initiateMFA(options);
|
|
1011
1010
|
};
|
|
1012
1011
|
;
|
|
1013
1012
|
/**
|