Reputation: 71
I have a specific need which is giving me some hard time. The basic requirement is: We need to Uniquely Identify the Device(can be a PC, Mac, Tablet, Phone) via one ID, just like an IMEI... This is needed due to some Licensing restrictions of some applications.
The challenge: We are running a Angular and the browser makes it nearly impossible to uniquely identify the device. As we are on the Browser sandbox, I have no chance to get something like a Mac address or anything that would be a good start in defining a unique ID.
What we tried so far:
MediaDeviceInfo.deviceId: https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo/deviceId
Valve´s FingerprintJS2: https://valve.github.io/fingerprintjs2/
Creating UID and saving on Localstorage: create a UID (How to generate UUID in angular 6) and store it on Local Storage. Some issues on our way:
I am aware that this problem has no easy solution, but I wanted to ask here if Someone faced a situation like this and how did they solve it. Of course if I would be able to run out of the browser sandbox having direct Access to device Information such as MAC address, IMEI or anything like that, it would be easy, but as mentioned, the browser sandbox is restrictive...
Ideas?
Thanks in advance!!!
Pedro
Upvotes: 5
Views: 13047
Reputation: 26617
I'm going to refer you to an answer I wrote back in 2018 which is still pretty much the same now: how can I get a unique device ID in javascript?
The short answer is: you can't, really.
You won't be able to get anything that uniquely identifies a device across all browsers and incognito vs regular. As you've found, you can get close, but it isn't a sure thing.
The best you can do is combine a couple of techniques together (like the fingerprint + stored UID) and it'll probably get 99% of cases, but you won't be able to get them all for sure.
Upvotes: 5