2FAuth
2FAuth copied to clipboard
Cannot select correct camera
Describe the bug When scanning a QR Code there is not apparent way to select which camera to use. In general this is not a problem, but rather an inconvenience. However my surface book 2 automatically selects the infrared camera which does not see the qr code from any screen. I don't see any way to circumvent this except to disable the ir camera hardware (not wanted).
To Reproduce Steps to reproduce the behavior:
- Go to 'https://instance'
- Click on 'Scan QR Code' -> 'https://instance/capture'
- Only option is cancel.
Expected behavior
- A list of cameras to select from,
- or a button to cycle through camera modes
Screenshots Since no error occurs there is nothing in the logs or anything. It just doesn't scan anything. Screen only shows B/W IR sensor image.
Desktop:
- OS: Windows 10 20H2
- Browser: chrome
- Version: 88
Smartphone:
- Read Camera default (also not changeable but not a major issue)
Hi,
For me this is an OS or browser behaviour that 2FAuth cannot handles.
I tested it on a win10 20H2 laptop with both Firefox and Chrome, and each behaves differently. Firefox allowed me to choose the cam to use when I was prompted for permission while Chrome only prompted me for permission, without any mention on the device to use.
However, once permission has been granted on Chrome, it is possible to clic (on the desktop version) the camera icon at the right end of the adress bar, it will show you a popup with a selector to choose the cam to use.
Does the icon exist on Chrome + Surface Pro 2? And what about the Win10 default cam setting? Did you tried to change it?
Oh, I have actually never seen that tab before ^^ However the Camera combobox is disabled on my browser. I cannot change the camera to use there. Ussually it just checks whether the access to cameras is enabled at all and shows which camera is currently in use. I thought it was always the applications job to pick the device. Here is a demo of device selection. I can not manually select the camera in the chrome camera authorization settings. Maybe I misconfigured my browser?
After some reads, you are right, this is not controlled by the browser, what I mentionned has nothing to do with device selection, it's just for permissions purpose.
For now the plugin 2FAuth uses for QR code detection do not provide a way to choose the cam: https://github.com/gruhn/vue-qrcode-reader/issues/179
This is mainly due by the device's ID that is neither the same between browsers nor persisted in sessions.
I could add a selector like in your demo but the user would have to choose a cam each time he uses 2FAuth, this is not a relevant solution.
This was not my demo, but i found it when looking at this topic.
Wouldn't it be feasible to add a button next to the camera button that just allows to cycle through the list of available devices? No persistence would be needed for that (i think)
This issue is addressed with a camera blacklist in the upstream package: https://github.com/gruhn/vue-qrcode-reader/blob/b057338f8c341ac74e6c1ac7f72ca6bf13117f73/src/misc/camera.js#L27
Please open an issue or a pull request at https://github.com/gruhn/vue-qrcode-reader to get the IR cam excluded.