Connect webpage to a USB smartcard reader

154 Views Asked by At

I need a webpage with access to a connected smartcard reader, what's the best way to achieve this?

WebUSB banned smartcard readers, the only way around it is to mess with the driver but it would break other things I need.

I thought about using a chrome extension but looks like they haven't got access to usb devices either.

Is the only solution a three layer application?

App running on the OS communicating with the usb device sending messages to -> extension -> webpage

I'm also kinda worried that manifest v3 might break something somehow

1

There are 1 best solutions below

6
Ethan Joseph On

Unfortunately, it seems a three layer solution is your only option. You simply cannot access native resources while sidestepping browser provided APIs to do so.

Please ensure whatever you end up developing is secure (the very reason smart cards are not allowed in the WebUSB API). Ensuring all communications with a locally hosted application are securely encrypted should be your first step.

This source provides useful insight into proxying unsupported smart card hardware.