is it possible to create a USB 2FA in php?

I was wondering if it is possible to create a usb 2FA in php? Or is it even possible to detect usb devices in php?

1 answer

  • answered 2020-06-27 04:58 user1597430

    It's possible only for the server where PHP is launched, but you should specify platform and technical details of your task. If we talk about Linux OS, you can scan /dev/sdX devices, mount them and read the data. The same logic for other OS.

    Also, if you want to use USB 2FA from the client's browser - you can read about WebUSB API (Chrome, Firefox). However, this API is not supported widely for security reasons and privacy concerns.