[web-nfc] Can I use Web-NFC to issue "commands" to NFC tags? (#452)

FernandoJAlves has just created a new issue for https://github.com/w3c/web-nfc:

== Can I use Web-NFC to issue "commands" to NFC tags? ==
Hey!

Not sure if this is the best place to ask this, but I couldn't find a forum or slack for this project. Anyway, my scenario is the following: I'm trying to use Web-NFC to communicate with the e-passport (more specifically, implement the Basic Access Control protocol). To do so, the protocol requires the device (in this case, a smartphone) to request a challenge to the NFC chip (in the passport), and then the chip would respond with a random number.

I have been able to create a functional NDEFReader (and tested it with other NFC tags), and I believe it is working correctly (I can perform reads). It does not read anything with the passport, due to the way the e-passport works (this is the expected behaviour as far as I know).

My problem lies with issuing the challenge to the passport. As far as I can understand, Web-NFC only provides the "push" command to send information from the active device (smartphone) to the NFC tag (passport), correct? Well, I tried multiple combinations of NDEFPushOptions, but the result is always the same: the push stays "pending" after interacting with the passport (it doesn't even call the 'then' or 'catch' methods). The NDEFReader also does not receive anything upon interacting with the passport.

Is this type of interaction (issuing a command) not supported by Web-NFC? This is my first time using this API, so I may have overlooked something in the documentation. I have previously used a NodeJS application (pokusew/nfc-pcsc), that uses external NFC readers, to implement the Basic Access Control protocol. This application has a method "transmit", where I pass the command, and it gets sent to the passport correctly (and then rest of the protocol continues). If anyone has already used this application, I'm looking for a way to emulate the behaviour of "transmit" using Web-NFC.

Thanks!

P.S.: If there is another way to get in touch with the development team of Web-NFC (a forum, or Slack, or something similar), I would love to join in on the discussion.


Please view or discuss this issue at https://github.com/w3c/web-nfc/issues/452 using your GitHub account

Received on Tuesday, 26 November 2019 17:57:52 UTC