Re: [webauthn] Find out whether passkeys are supported without passing value to publicKey parameter in .get() (#2262)

And in order to check if the browser supports _some_ kind of WebAuthn credentials, but not necessarily user-verifying discoverable platform credentials, then you can check for the existence of `window["PublicKeyCredential"]`:

```js
if (window["PublicKeyCredential"]) {
  // WebAuthn support exists in browser (but no guarantee that any authenticator is available)

  if ((await PublicKeyCredential.getClientCapabilities()).passkeyPlatformAuthenticator) {
    // Built-in passkey authenticator or hybrid transport is available
    navigator.credentials.get(/* ... */)
  } else {
    // Built-in passkey authenticator is not available, but some other kind of authenticator may be supported
    navigator.credentials.get(/* ... */)
  }
} else {
  // WebAuthn is not supported
}
```

-- 
GitHub Notification of comment by emlun
Please view or discuss this issue at https://github.com/w3c/webauthn/issues/2262#issuecomment-2674119222 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 21 February 2025 10:06:30 UTC