Magento2 how to Authenticate user by Mac Address? Also how to get and set MAC address in Magento2


  • Super Admin Can set one field while user creates in admin panel. The field name is "Mac Address". And Save it in a database.(statically input)

  • once Newley created the admin user is login with this appropriate mac address then and then is an authentic person and then he allows to login.

  • otherwise he will not allow to login.

2 Answers 2


Mac Address

  • Simply you can not get the MAC address of your client because it never passes the router to avoid the security problems. You may get MAC address in some exceptional circumstances and to get a MAC address you will have to use ActiveX controls which only work on MS internet explorer and most of the systems use default set to dont run ActiveX controls . Reason is same again to prevent security problems. From Your question it seems like you want to use MAC address for identification but that is not a good idea , because just few click/commands MAC address can be spoofed. In-stead you may implement 2-way authentication like sending OTP to registered phone number and verifying it before logging in

MAC address is not the part of the http protocol, it’s not passed to the website.

In IPv6, the 64 bit "host" part of the full 128 bit address is often automatically generated from the MAC address, and hence might be visible to the server one connects to. Key words here are «often» and «might».

Only some native application, Java applet or activeX component can get MAC address and pass it to the website in a separate request.

There are solutions to filter admin users by IP, some secret cookie, 2-Factor Authentication or using a VPN to access separate admin server.

  • okay. but i have to do this task. any other method ?
    – Divyesh
    Oct 3, 2017 at 6:54
  • I’ve listed other possible methods in the answer alredy. Oct 3, 2017 at 7:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.