Can a chrome extension directly initiate the (chrome) WebAuthn / PassKey dialogue?

162 Views Asked by At

I have a TS-based web app that calls upon WebAuthn and opens the chrome dialogue to select PassKey method - working as expected.

When the same code is used inside a chrome extension, the request to the server for auth is received and returns the first part of the response with no errors (200), however no WebAuthn native dialogue appears. Still no network or log errors on front or back end.

I am struggling to find any documentation that suggests how a chrome extension does or does not handle WebAuthn / PassKeys directly.

2

There are 2 best solutions below

1
On BEST ANSWER

Background pages, when open in a tab, can use WebAuthn. Leave the rp.id field blank and the RP ID will be chrome-extension://…. (I.e. this is only useful for extensions issuing credentials to themselves, so think about that first because it's a significant limitation.)

There is support behind a flag in Chrome to allow background pages to use a regular origin as an RP ID and something might be done with manifests too, but none of that is released yet.

0
On

Having spoken to the author of https://github.com/MasterKale/SimpleWebAuthn

The general answer seems to be 'not really' right now, but is a work in progress with the respective parties.