cidaas-javascript-sdk 2.2.5 → 2.2.7
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 +2 -5
- package/package.json +2 -1
- package/src/main/web-auth/webauth.js +25 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
## [2.2.
|
|
1
|
+
## [2.2.7](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/compare/v2.2.6...v2.2.7) (2023-02-06)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Bug Fixes
|
|
5
5
|
|
|
6
|
-
* **[gitlab-240](https://gitlab.widas.de/cidaas-v2/auth/issues/-/issues/240):**
|
|
7
|
-
* removed nexus ([fe57fd9](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/fe57fd9cb77634bee184cf5e2dd6045af9bf648d))
|
|
8
|
-
* sync from development ([4d38430](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/4d3843018999401ef82ea52e998b910b992d4067))
|
|
9
|
-
* sync from development ([35294aa](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/35294aa746b2a5e488f826970faad2f23bedca37))
|
|
6
|
+
* **[gitlab-240](https://gitlab.widas.de/cidaas-v2/auth/issues/-/issues/240):** added cookie for device_dr ([bb50022](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/bb5002253e36fdccd1052bba746e2efbcd031a07))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cidaas-javascript-sdk",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.7",
|
|
4
4
|
"author": "cidaas by Widas ID GmbH",
|
|
5
5
|
"description": "Cidaas native javascript sdk",
|
|
6
6
|
"license": "MIT",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"registry": "https://registry.npmjs.org/"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
+
"@fingerprintjs/fingerprintjs": "^3.4.0",
|
|
30
31
|
"@types/node": "^18.11.18",
|
|
31
32
|
"crypto-js": "^4.1.1",
|
|
32
33
|
"oidc-client": "^1.11.5"
|
|
@@ -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 fingerprint = require('@fingerprintjs/fingerprintjs')
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
var code_verifier;
|
|
@@ -1938,25 +1939,33 @@ WebAuth.prototype.setAcceptLanguageHeader = function (acceptLanguage) {
|
|
|
1938
1939
|
}
|
|
1939
1940
|
|
|
1940
1941
|
// get device info
|
|
1941
|
-
WebAuth.prototype.getDeviceInfo = function (
|
|
1942
|
+
WebAuth.prototype.getDeviceInfo = function () {
|
|
1942
1943
|
return new Promise(function (resolve, reject) {
|
|
1943
1944
|
try {
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
}
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1945
|
+
const value = ('; '+document.cookie).split(`; cidaas_dr=`).pop().split(';')[0];
|
|
1946
|
+
const fpPromise = fingerprint.load();
|
|
1947
|
+
var options = {fingerprint:"", userAgent:""};
|
|
1948
|
+
if(!value) {
|
|
1949
|
+
(async () => {
|
|
1950
|
+
const fp = await fpPromise;
|
|
1951
|
+
const result = await fp.get();
|
|
1952
|
+
options.fingerprint = result.visitorId
|
|
1953
|
+
options.userAgent = window.navigator.userAgent
|
|
1954
|
+
var http = new XMLHttpRequest();
|
|
1955
|
+
var _serviceURL = window.webAuthSettings.authority + "/device-srv/deviceinfo";
|
|
1956
|
+
http.onreadystatechange = function () {
|
|
1957
|
+
if (http.readyState == 4) {
|
|
1958
|
+
resolve(JSON.parse(http.responseText));
|
|
1959
|
+
}
|
|
1960
|
+
};
|
|
1961
|
+
http.open("POST", _serviceURL, true);
|
|
1962
|
+
http.setRequestHeader("Content-type", "application/json");
|
|
1963
|
+
if (window.localeSettings) {
|
|
1964
|
+
http.setRequestHeader("accept-language", window.localeSettings);
|
|
1965
|
+
}
|
|
1966
|
+
http.send(JSON.stringify(options));
|
|
1967
|
+
})();
|
|
1958
1968
|
}
|
|
1959
|
-
http.send(JSON.stringify(options));
|
|
1960
1969
|
} catch (ex) {
|
|
1961
1970
|
reject(ex);
|
|
1962
1971
|
}
|