1

I am looking to retrieve the Mac_Address of the user accessing my application. I have tried the following code:

import uuid
from uuid import getnode as get_mac
mac_address = get_mac()
mac_address = ':'.join(("%012X" % mac_address)[i:i+2] for i in range(0, 12, 2))

This works OK but returns the mac address of the server and not the client. Is there a way to retrieve the mac address of the client?

Tauseef Hussain
  • 1,049
  • 4
  • 15
  • 29

3 Answers3

3

The HTTP protocol does not send the MAC address of the client to the server, so there's no way for your server-side application to access it.

yole
  • 92,896
  • 20
  • 260
  • 197
2

The client's MAC address is never revealed to the outside network. Thus it is not possible to get it. The only way for it is to install your app on user's machine.

Igor
  • 2,834
  • 2
  • 26
  • 44
  • 1
    Thanks for that. When I use `qlikview` i can easily retrieve the user mac adress but now I realise that it is only for the installed version of it and not the web version. – Tauseef Hussain Jan 06 '16 at 10:04
2

You will only be able to retrieve the MAC address of users who happen to be on the same LAN network segment as you are, so it is probably not a good idea to bake in the assumption that you can rely on the user's MAC address being available.

Vatine
  • 20,782
  • 4
  • 54
  • 70