We recently purchased a RFID reader for document tracking. It came with a demo software written in C#.
Is it possible to access and control RFID readers using web applications?
Is it possible to access and control RFID readers using web applications?
Not directly, because that would be a massive breach of web security. Webbrowsers go to great lengths to segregate websites from each other and the system (seriously questionable things like WebUSB nonwithstanding).
The usual approach to do what you seek is to have a small webserver talking to the RFID reader and providing a HTTP based API. Of course doing this will require Cross Origin Resource Sharing.
The biggest mistake you can make is create a DNS entry like local-rfid.yourorg.example.com
and map that to 127.x.x.x
and/or ::1
in order to have a signable TLS cert for that domain. The problem is, that you'd have to ship the private key with your RFID interface program, and that key might be compromised, which would enable arbitrary software using that key to use your DNS entry to compromise HTTPS sessions. So don't do that!
The correct way to do this, is accessing your RFID reader under the localhost
domain (which is exempt from requiring TLS for CORS), and for the web application you want to be able to access the particular local service with a HTTP header, specifying the service like this
Access-Control-Allow-Origin: http://localhost:3000
and just as important use some web authentication scheme like OAuth2 or such to authenticate your browser based application against the RFID reader service, i.e. when a request to the RFID reader service is made, pass a session token to it (via a cookie, or request header) and then have the RFID reader service check against your application server, if that token is valid.