NFC based authorisation

226 Views Asked by At

I`m working on my university project implementing 2-step NFC Based authorisation.

Got a couple of questions.

I`m using android HCE feature to pass a login data to NFC reader. NFC reader is driven by chrome extension.

  1. Is there any possibility to launch chrome extension from website in iframe for example or in background?(chrome app uses usb feature, so i need launch it in chrome and explicitly launch this application, in other way i can`t use my nfc feature) The only way to solve i stuck into is url_handlers, but this seems not elegant.
  2. Also if the first fails - am i able to pass NFC data to validation server, fetch answer, set cookie, close app and redirect user to main page?

UPDATE: The website and extension is opened on PC in chrome browser, Android used only for HCE emulating app

1

There are 1 best solutions below

0
On BEST ANSWER

It's unclear what environment you are trying to do this on. You mention Android, but if you are on the device see the Google Chrome FAQ

Does Chrome for Android support apps and extensions?
    Chrome apps and extensions are currently not supported on Chrome
    for Android. We have no plans to announce at this time.

If you are on the Chrome browser for desktop and on a page that chrome loads content scripts on, the content script can listen for an event. So, your iframe could fire the event and the chrome extension could pick up the logic from there.

For your second question, that doesn't sound like a chrome question, it sounds like a simple ajax call and callback, though I don't think cookies are relevant in an Android app (there is storage you could use though). There are a lot of good Android tutorials you could work through to get more versed in what's possible.