cidaas-javascript-sdk 2.2.3 → 2.2.4
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 +10 -0
- package/package.json +2 -1
- package/src/main/web-auth/webauth.js +64 -1
- package/src/test/sum.js +4 -0
- package/src/test/test.js +5 -0
- package/types/.DS_Store +0 -0
- package/types/authentication/index.d.ts +0 -15
- package/types/index.d.ts +0 -5
- package/types/web-auth/exception.d.ts +0 -7
- package/types/web-auth/webauth.d.ts +0 -138
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
## [2.2.4](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/compare/v2.2.3...v2.2.4) (2023-01-30)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **[gitlab-240](https://gitlab.widas.de/cidaas-v2/auth/issues/-/issues/240):** added getDevices & deleteDevices ([1dade9a](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/1dade9a3502d69ca4569ad72e456b3cf879afc34))
|
|
7
|
+
* **[gitlab-240](https://gitlab.widas.de/cidaas-v2/auth/issues/-/issues/240):** removed user-agent ([6061c4b](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/6061c4bc174150a5afdf84560627211558dddeb0))
|
|
8
|
+
* added unique deviceID instead of crypto ([bb9870b](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/bb9870be86a7a2292d658ba4a5f9209e8bc17e53))
|
|
9
|
+
* added unique deviceID instead of crypto ([80e5acc](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/80e5acc33e693a7bcbb7602bf147c416f7e26f2d))
|
|
10
|
+
* remove nexus refs ([f4f1cc4](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/f4f1cc4b1090fc3f333684cf2e428c0f731d3bc9))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cidaas-javascript-sdk",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.4",
|
|
4
4
|
"author": "cidaas by Widas ID GmbH",
|
|
5
5
|
"description": "Cidaas native javascript sdk",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@types/node": "^18.11.18",
|
|
31
31
|
"crypto-js": "^4.1.1",
|
|
32
|
+
"device-uuid": "^1.0.4",
|
|
32
33
|
"oidc-client": "^1.11.5"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
|
@@ -2,6 +2,7 @@ var Authentication = require('../authentication');
|
|
|
2
2
|
var CustomException = require('./exception');
|
|
3
3
|
var Oidc = require('oidc-client');
|
|
4
4
|
var CryptoJS = require("crypto-js");
|
|
5
|
+
var deviceID = require("device-uuid")
|
|
5
6
|
|
|
6
7
|
var code_verifier;
|
|
7
8
|
|
|
@@ -594,6 +595,66 @@ WebAuth.prototype.getClientInfo = function (options) {
|
|
|
594
595
|
});
|
|
595
596
|
};
|
|
596
597
|
|
|
598
|
+
// get all devices associated to the client
|
|
599
|
+
WebAuth.prototype.getDevicesInfo = function (options) {
|
|
600
|
+
return new Promise(function (resolve, reject) {
|
|
601
|
+
try {
|
|
602
|
+
var http = new XMLHttpRequest();
|
|
603
|
+
var _serviceURL = window.webAuthSettings.authority + "/device-srv/devices";
|
|
604
|
+
http.onreadystatechange = function () {
|
|
605
|
+
if (http.readyState == 4) {
|
|
606
|
+
if (http.responseText) {
|
|
607
|
+
resolve(JSON.parse(http.responseText));
|
|
608
|
+
} else {
|
|
609
|
+
resolve(false);
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
};
|
|
613
|
+
http.open("GET", _serviceURL, true);
|
|
614
|
+
http.setRequestHeader("Content-type", "application/json");
|
|
615
|
+
if (window.localeSettings) {
|
|
616
|
+
http.setRequestHeader("accept-language", window.localeSettings);
|
|
617
|
+
}
|
|
618
|
+
if(window.navigator.userAgent) {
|
|
619
|
+
http.setRequestBody("userAgent", window.navigator.userAgent)
|
|
620
|
+
}
|
|
621
|
+
http.send();
|
|
622
|
+
} catch (ex) {
|
|
623
|
+
reject(ex);
|
|
624
|
+
}
|
|
625
|
+
});
|
|
626
|
+
};
|
|
627
|
+
|
|
628
|
+
// delete a device
|
|
629
|
+
WebAuth.prototype.deleteDevice = function (options) {
|
|
630
|
+
return new Promise(function (resolve, reject) {
|
|
631
|
+
try {
|
|
632
|
+
var http = new XMLHttpRequest();
|
|
633
|
+
var _serviceURL = window.webAuthSettings.authority + "/device-srv/device/" + options.device_id;
|
|
634
|
+
http.onreadystatechange = function () {
|
|
635
|
+
if (http.readyState == 4) {
|
|
636
|
+
if (http.responseText) {
|
|
637
|
+
resolve(JSON.parse(http.responseText));
|
|
638
|
+
} else {
|
|
639
|
+
resolve(false);
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
};
|
|
643
|
+
http.open("DELETE", _serviceURL, true);
|
|
644
|
+
http.setRequestHeader("Content-type", "application/json");
|
|
645
|
+
if (window.localeSettings) {
|
|
646
|
+
http.setRequestHeader("accept-language", window.localeSettings);
|
|
647
|
+
}
|
|
648
|
+
if(window.navigator.userAgent) {
|
|
649
|
+
http.setRequestBody("userAgent", window.navigator.userAgent)
|
|
650
|
+
}
|
|
651
|
+
http.send();
|
|
652
|
+
} catch (ex) {
|
|
653
|
+
reject(ex);
|
|
654
|
+
}
|
|
655
|
+
});
|
|
656
|
+
};
|
|
657
|
+
|
|
597
658
|
// get Registration setup
|
|
598
659
|
WebAuth.prototype.getRegistrationSetup = function (options) {
|
|
599
660
|
return new Promise(function (resolve, reject) {
|
|
@@ -1880,7 +1941,9 @@ WebAuth.prototype.setAcceptLanguageHeader = function (acceptLanguage) {
|
|
|
1880
1941
|
WebAuth.prototype.getDeviceInfo = function (options) {
|
|
1881
1942
|
return new Promise(function (resolve, reject) {
|
|
1882
1943
|
try {
|
|
1883
|
-
options.deviceFingerprint
|
|
1944
|
+
if(!options.deviceFingerprint) {
|
|
1945
|
+
options.deviceFingerprint = new DeviceUUID().get();
|
|
1946
|
+
}
|
|
1884
1947
|
var http = new XMLHttpRequest();
|
|
1885
1948
|
var _serviceURL = window.webAuthSettings.authority + "/device-srv/deviceinfo";
|
|
1886
1949
|
http.onreadystatechange = function () {
|
package/src/test/sum.js
ADDED
package/src/test/test.js
ADDED
package/types/.DS_Store
ADDED
|
Binary file
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export = Authentication;
|
|
2
|
-
declare function Authentication(): void;
|
|
3
|
-
declare class Authentication {
|
|
4
|
-
redirectSignIn(view_type: any): void;
|
|
5
|
-
redirectSignInCallback(): Promise<any>;
|
|
6
|
-
redirectSignOut(): Promise<any>;
|
|
7
|
-
redirectSignOutCallback(): Promise<any>;
|
|
8
|
-
popupSignIn(): void;
|
|
9
|
-
popupSignInCallback(): void;
|
|
10
|
-
popupSignOut(): void;
|
|
11
|
-
popupSignOutCallback(): void;
|
|
12
|
-
silentSignIn(): void;
|
|
13
|
-
silentSignInCallback(): void;
|
|
14
|
-
silentSignInCallbackV2(): Promise<any>;
|
|
15
|
-
}
|
package/types/index.d.ts
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
export = WebAuth;
|
|
2
|
-
declare function WebAuth(settings: any): void;
|
|
3
|
-
declare class WebAuth {
|
|
4
|
-
constructor(settings: any);
|
|
5
|
-
loginWithBrowser(): void;
|
|
6
|
-
registerWithBrowser(): void;
|
|
7
|
-
loginCallback(): Promise<any>;
|
|
8
|
-
getUserInfo(): Promise<any>;
|
|
9
|
-
getUserProfile(options: any): Promise<any>;
|
|
10
|
-
getProfileInfo(access_token: any): Promise<any>;
|
|
11
|
-
logout(): Promise<any>;
|
|
12
|
-
logoutCallback(): Promise<any>;
|
|
13
|
-
renewToken(options: any): Promise<any>;
|
|
14
|
-
generateCodeVerifier(): void;
|
|
15
|
-
generateRandomString(length: any): string;
|
|
16
|
-
generateCodeChallenge(code_verifier: any): any;
|
|
17
|
-
base64URL(string: any): any;
|
|
18
|
-
getLoginURL(): string;
|
|
19
|
-
getAccessToken(options: any): Promise<any>;
|
|
20
|
-
validateAccessToken(options: any): Promise<any>;
|
|
21
|
-
getRequestId(): Promise<any>;
|
|
22
|
-
loginWithCredentials(options: any): void;
|
|
23
|
-
loginWithCredentialsAsynFn(options: any): Promise<Response>;
|
|
24
|
-
loginWithSocial(options: any, queryParams: any): void;
|
|
25
|
-
registerWithSocial(options: any, queryParams: any): void;
|
|
26
|
-
getMissingFields(options: any): Promise<any>;
|
|
27
|
-
getTenantInfo(): Promise<any>;
|
|
28
|
-
logoutUser(options: any): void;
|
|
29
|
-
getClientInfo(options: any): Promise<any>;
|
|
30
|
-
getRegistrationSetup(options: any): Promise<any>;
|
|
31
|
-
register(options: any, headers: any): Promise<any>;
|
|
32
|
-
getInviteUserDetails(options: any): Promise<any>;
|
|
33
|
-
getCommunicationStatus(options: any): Promise<any>;
|
|
34
|
-
initiateAccountVerification(options: any): void;
|
|
35
|
-
initiateAccountVerificationAsynFn(options: any): Promise<Response>;
|
|
36
|
-
verifyAccount(options: any): Promise<any>;
|
|
37
|
-
initiateResetPassword(options: any): Promise<any>;
|
|
38
|
-
handleResetPassword(options: any): void;
|
|
39
|
-
resetPassword(options: any): void;
|
|
40
|
-
getMFAList(options: any): Promise<any>;
|
|
41
|
-
getMFAListV2(options: any): Promise<any>;
|
|
42
|
-
initiateMFAV2(options: any): Promise<any>;
|
|
43
|
-
initiateEmail(options: any): Promise<any>;
|
|
44
|
-
initiateEmailV2(options: any): Promise<any>;
|
|
45
|
-
initiateSMS(options: any): Promise<any>;
|
|
46
|
-
initiateSMSV2(options: any): Promise<any>;
|
|
47
|
-
initiateIVR(options: any): Promise<any>;
|
|
48
|
-
initiateIVRV2(options: any): Promise<any>;
|
|
49
|
-
initiateBackupcode(options: any): Promise<any>;
|
|
50
|
-
initiateBackupcodeV2(options: any): Promise<any>;
|
|
51
|
-
initiateTOTP(options: any): Promise<any>;
|
|
52
|
-
initiateTOTPV2(options: any): Promise<any>;
|
|
53
|
-
initiatePattern(options: any): Promise<any>;
|
|
54
|
-
initiatePatternV2(options: any): Promise<any>;
|
|
55
|
-
initiateTouchId(options: any): Promise<any>;
|
|
56
|
-
initiateTouchIdV2(options: any): Promise<any>;
|
|
57
|
-
initiateSmartPush(options: any): Promise<any>;
|
|
58
|
-
initiateSmartPushV2(options: any): Promise<any>;
|
|
59
|
-
initiateFace(options: any): Promise<any>;
|
|
60
|
-
initiateFaceV2(options: any): Promise<any>;
|
|
61
|
-
initiateVoice(options: any): Promise<any>;
|
|
62
|
-
initiateVoiceV2(options: any): Promise<any>;
|
|
63
|
-
authenticateMFAV2(options: any): Promise<any>;
|
|
64
|
-
cancelMFAV2(options: any): Promise<any>;
|
|
65
|
-
authenticateEmail(options: any): Promise<any>;
|
|
66
|
-
authenticateEmailV2(options: any): Promise<any>;
|
|
67
|
-
authenticateSMS(options: any): Promise<any>;
|
|
68
|
-
authenticateSMSV2(options: any): Promise<any>;
|
|
69
|
-
authenticateIVR(options: any): Promise<any>;
|
|
70
|
-
authenticateIVRV2(options: any): Promise<any>;
|
|
71
|
-
authenticateBackupcode(options: any): Promise<any>;
|
|
72
|
-
authenticateBackupcodeV2(options: any): Promise<any>;
|
|
73
|
-
authenticateTOTP(options: any): Promise<any>;
|
|
74
|
-
authenticateTOTPV2(options: any): Promise<any>;
|
|
75
|
-
passwordlessLogin(options: any): void;
|
|
76
|
-
getConsentDetails(options: any): Promise<any>;
|
|
77
|
-
getConsentDetailsV2(options: any): Promise<any>;
|
|
78
|
-
acceptConsent(options: any): Promise<any>;
|
|
79
|
-
acceptConsentV2(options: any): Promise<any>;
|
|
80
|
-
getScopeConsentDetails(options: any): Promise<any>;
|
|
81
|
-
getScopeConsentVersionDetailsV2(options: any): Promise<any>;
|
|
82
|
-
acceptScopeConsent(options: any): Promise<any>;
|
|
83
|
-
scopeConsentContinue(options: any): void;
|
|
84
|
-
acceptClaimConsent(options: any): Promise<any>;
|
|
85
|
-
claimConsentContinue(options: any): void;
|
|
86
|
-
revokeClaimConsent(options: any): Promise<any>;
|
|
87
|
-
getDeduplicationDetails(options: any): Promise<any>;
|
|
88
|
-
deduplicationLogin(options: any): void;
|
|
89
|
-
registerDeduplication(options: any): Promise<any>;
|
|
90
|
-
consentContinue(options: any): void;
|
|
91
|
-
mfaContinue(options: any): void;
|
|
92
|
-
firstTimeChangePassword(options: any): void;
|
|
93
|
-
changePassword(options: any, access_token: any): Promise<any>;
|
|
94
|
-
updateProfile(options: any, access_token: any, sub: any): Promise<any>;
|
|
95
|
-
getUserActivities(options: any, access_token: any): Promise<any>;
|
|
96
|
-
getUnreviewedDevices(access_token: any, sub: any): Promise<any>;
|
|
97
|
-
getReviewedDevices(access_token: any, sub: any): Promise<any>;
|
|
98
|
-
reviewDevice(options: any, access_token: any, sub: any): Promise<any>;
|
|
99
|
-
getAcceptedConsentList(options: any, access_token: any): Promise<any>;
|
|
100
|
-
viewAcceptedConsent(options: any, access_token: any): Promise<any>;
|
|
101
|
-
getConfiguredVerificationList(options: any, access_token: any): Promise<any>;
|
|
102
|
-
initiateLinkAccount(options: any, access_token: any): Promise<any>;
|
|
103
|
-
completeLinkAccount(options: any, access_token: any): Promise<any>;
|
|
104
|
-
getLinkedUsers(access_token: any, sub: any): Promise<any>;
|
|
105
|
-
unlinkAccount(access_token: any, identityId: any): Promise<any>;
|
|
106
|
-
getAllVerificationList(access_token: any): Promise<any>;
|
|
107
|
-
updateProfileImage(options: any, access_token: any): Promise<any>;
|
|
108
|
-
setupEmail(options: any): Promise<any>;
|
|
109
|
-
setupSMS(options: any): Promise<any>;
|
|
110
|
-
setupIVR(options: any): Promise<any>;
|
|
111
|
-
setupBackupcode(options: any, access_token: any): Promise<any>;
|
|
112
|
-
setupTOTP(options: any, access_token: any): Promise<any>;
|
|
113
|
-
setupPattern(options: any, access_token: any): Promise<any>;
|
|
114
|
-
setupTouchId(options: any, access_token: any): Promise<any>;
|
|
115
|
-
setupSmartPush(options: any, access_token: any): Promise<any>;
|
|
116
|
-
setupFace(options: any, access_token: any): Promise<any>;
|
|
117
|
-
setupVoice(options: any, access_token: any): Promise<any>;
|
|
118
|
-
enrollEmail(options: any, access_token: any): Promise<any>;
|
|
119
|
-
enrollSMS(options: any, access_token: any): Promise<any>;
|
|
120
|
-
enrollIVR(options: any, access_token: any): Promise<any>;
|
|
121
|
-
enrollTOTP(options: any, access_token: any): Promise<any>;
|
|
122
|
-
updateSuggestMFA(track_id: any, options: any): Promise<any>;
|
|
123
|
-
enrollVerification(options: any): Promise<any>;
|
|
124
|
-
updateSocket(status_id: any): Promise<any>;
|
|
125
|
-
setupFidoVerification(options: any): Promise<any>;
|
|
126
|
-
checkVerificationTypeConfigured(options: any): Promise<any>;
|
|
127
|
-
authenticateVerification(options: any): Promise<any>;
|
|
128
|
-
authenticateFaceVerification(options: any): Promise<any>;
|
|
129
|
-
initiateVerification(options: any): Promise<any>;
|
|
130
|
-
deleteUserAccount(options: any): Promise<any>;
|
|
131
|
-
getMissingFieldsLogin(trackId: any): Promise<any>;
|
|
132
|
-
progressiveRegistration(options: any, headers: any): Promise<any>;
|
|
133
|
-
loginAfterRegister(options: any): void;
|
|
134
|
-
deviceCodeVerify(code: any): void;
|
|
135
|
-
userCheckExists(options: any): Promise<any>;
|
|
136
|
-
setAcceptLanguageHeader(acceptLanguage: any): void;
|
|
137
|
-
getDeviceInfo(options: any): Promise<any>;
|
|
138
|
-
}
|