0

I am developing a React application that includes a POS that will run in several stores. I want to link the specific computer with a store, so when the POS is started, it automatically would send requests to the server with the store id the computer is linked to.

I think the only way is to get the mac address of the computer, and to use such mac address to link the pc to the store on the database, but I can't find a way to get the client mac address from React.

I don't want to use a cookie because the link between the store and the computer is a step that has to be performed by a supervisor, and they are not always available at the stores, and so the store would be unable to sell if the cookies al cleared from the browser until a supervisor arrives.

How can I get the client's mac address and, if not possible, how would you advise to handle this issue?

Thanks for your answer.

HuLu ViCa
  • 3,591
  • 3
  • 29
  • 44
  • 1
    I don't know if there is a better answer so I'm leaving this as a comment... When I faced this situation I had a bash script on the client device that ran at startup, found the MAC address, and then opened a browser window in kiosk mode with the MAC address in the URL. (ex the script opens https://yourkiosksite.com/mac/DEVICEMAC) – Ryan Z Jun 15 '20 at 23:53
  • It's not possible to get the client's MAC address with Javascript (https://stackoverflow.com/questions/3385/mac-addresses-in-javascript), and with PHP you can only get the client's IP (https://stackoverflow.com/questions/1420381/how-can-i-get-the-mac-and-the-ip-address-of-a-connected-client-in-php). – GalaxyCat105 Jun 15 '20 at 23:53
  • Sorry, I think I misunderstood the question. Maybe you could use a VLAN (virtual LAN) with PHP? – GalaxyCat105 Jun 16 '20 at 00:00
  • @GalaxyCat105 Sorry, my project is in React – HuLu ViCa Jun 16 '20 at 00:00
  • If you have access to the NodeJS running on the backend of the server, you could use it with a VLAN, and then you could use something like socket.io to send that info to the client. (Maybe use something like https://github.com/bcamarneiro/macfromip to get address with NodeJS) – GalaxyCat105 Jun 16 '20 at 00:22
  • @RyanZ That's a very good answer – HuLu ViCa Jun 16 '20 at 00:47

0 Answers0