ID Card Reader using Drupal or PHP

1k views Asked by At

Is there a working module in Drupal for reading user information from an ID Card using an ID Card reader? If there's none, is there a way to do it in PHP?

Because what I want to do is that when the users swipe their ID cards to the ID Card Reader, they will be marked as logged in to the Drupal website.

How is this possible?

2

There are 2 answers

0
Michael Noyb On BEST ANSWER

my 2 cents: IMHO: You are talking about two different worlds here.

Your card reader is connected to a PC, which needs to run a driver in order to talk to the card reader (and thus a driver must exist for the OS running that computer).

Once the PC and card reader can talk to each other, you need some kind of native program that connects to this card reader and listens to it's output (user id, etc) - again specific to the OS.

Then you need to tell the program to trigger an action once it has read the data it's looking for: Like calling a specific URL - and now finally we are at the point where you can and should do something with PHP (handling the request) - since we are now finally in the "web" domain.

Everything up to this point has to be implemented with either an existing solution or a custom solution (depends on the Card Reader and OS).

0
Quint On

Assuming that the card reader is installed on the computer already, it shouldn't be difficult. Card readers just deliver ASCII characters to the OS at the end of the line (assuming we are dealing with just a standard reader).

When the user first visits your site you can use js to put the cursor in the input field. When your user swipes their card, the text is placed in the field. At that point, you could have the user press enter to submit, or you could use a timer to auto-submit .5 seconds after the last character is received.

I have done similar work with barcode readers (for data retrieval, not login) and it worked very well.