Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check browser for U2F capability

Is there a way to check whether a browser supports U2F or not?

I know that right now, Chrome is the only browser that officially does U2F, but there are addons for Firefox and there may also be customized browsers which may have gotten U2F.

I don't want to ditch such browsers like Google does, because the addon users wouldn't be able to use it.

I saw that GitHub seems to have a way to see it (because it distinguished between Firefox with and without addon), but I have no idea how to do that.

like image 746
My1 Avatar asked Jan 27 '16 23:01

My1


People also ask

What is U2F browser support?

- UNOFF. JavaScript API to interact with Universal Second Factor (U2F) devices. This allows users to log into sites more securely using two-factor authentication with a USB dongle.

What browsers support security keys?

With a security key you purchased On your computer, open a compatible browser like Chrome, Firefox, Edge, or Opera.

Is U2F deprecated?

U2F security keys themselves are not deprecated and will continue to work. U2F is Chrome's original security key API. It allows sites to register public key credentials on USB security keys and challenge them for building phishing-resistant two-factor authentication systems.

Does FIDO2 support Firefox?

The latest version of Firefox supports FIDO2 and U2F keys : FIDO2 has been supported since version 66.0. 32.


1 Answers

Use library caniuse-support, which uses information from the service caniuse.com (https://caniuse.com/#feat=u2f) and uses library bowser (browser detector):

const {
  getSupport,
  currentBrowser,
} = CaniuseSupport;

const test1 = getSupport("u2f"); // current browser

console.log(
  "Get feature support of U2F current browser (" +
    currentBrowser.id +
    " " +
    currentBrowser.version +
    "):",
  test1.level
);

CodePen sandbox

like image 168
Artee Avatar answered Oct 08 '22 03:10

Artee