5

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

    • In one hand, on the first tests I made on my Chrome, it came empty and additionally it is not supported on Safari...
  • Valve´s FingerprintJS2: https://valve.github.io/fingerprintjs2/

    • At a first sight we think we hit the Jackpot as it properly generated the same ID, even if I called it from an Anonymous window! But, It still generates another ID for a different browser...
    • Basically It works by enumerating all browser capabilities(at least the ones accessible) and then by creating a hash of that... The Issue: If you have devices with exactly same configurations, they will have the same ID! I tried that on 2 iPhones that have the same config and were even bought on same day! :-)
  • 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

PCBL
  • 71
  • 1
  • 4

1 Answers1

5

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.

samanime
  • 25,408
  • 15
  • 90
  • 139
  • thanks for your answer, @samanime, I was hoping someone come out with something that I was missing! :-) What we will endup doing is instead of trying to identify the Client completelly from the Browser, we might write some code on the backend based on the IP address of the caller or any other information which we could get. Of course if the client is coming from a NAT request, or is under a proxy, we would get the same IP address, so then we could use the fingerprint + uuid and in the end go to something closer to 99.9! :-) If we are on a LAN we can even try to get the MAC address... – PCBL Aug 20 '20 at 15:13
  • @PCBL, Just wondering what the best solution you have come up with so far. I am trying to build something that will permit the authorization of an individual device to display an image, such that no other device could retrieve the image. I suspect a determined hacker could probably any scenario I can come up with, but wondering what solution you have come up with. – GGizmos Nov 29 '22 at 19:40