6

Is there a way to get the device's unique id using JQuery/JavaScript.

I know one can detect the user agent and type of device that is being used but that is not required. I need to know the unique id that is being used.

Having said that I also know that browser is the least priviliged application running on the machine and it should be able to get that id.

But still asking if there is a way?

рüффп
  • 5,172
  • 34
  • 67
  • 113
Salman
  • 3,137
  • 4
  • 23
  • 31
  • You mean like the MAC Address? – Ian May 14 '13 at 13:47
  • @Ian Yeah, that would do. – Salman May 14 '13 at 13:47
  • 2
    What are you using this unique ID for? It's possible to generate a unique cookie-based ID for each user without accessing the hardware. See [this](http://stackoverflow.com/questions/216542/how-do-i-uniquely-identify-computers-visiting-my-web-site) and [this](http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript) question. – Blazemonger May 14 '13 at 13:52
  • 1
    Try to design your application such that you only need to identify users, not their physical machines. – techfoobar May 14 '13 at 13:53
  • I am currently using SignalR to connect multiple devices. I need to identify each device uniquely every time it connects with server. If i assing a random unique id then it would always be different. So i am looking for a way a device can tell who it is other than the user who is connected via that device – Salman May 16 '13 at 07:15

1 Answers1

7

Not possible as far as I know.

I believe it's a security issue. Your device ID is very sensitive information that you wouldn't want just any website being able to capture.

Update:

It's not possible (without any hackery at least) to physically distinguish the computers accessing a web site without the permission of their owners. You can store a cookie to identify the machine when it visits your site again but the key is that the user is in control, and rightly so.

Gurpreet Singh
  • 20,907
  • 5
  • 44
  • 60
  • 2
    Yeah i totally undestand that. Having a MAC Address exposed is very sensitive. But i need a unique ID for the device. It could be anything like machine name etc – Salman May 14 '13 at 13:52
  • 2
    generate an GUID an store it locally in a cookie, reuse the value on subsequent app runs – Adi Jul 09 '15 at 20:18