Bug 225233 - WebAuthn API error messages too vague when Touch ID is unavailable
Summary: WebAuthn API error messages too vague when Touch ID is unavailable
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: Safari 14
Hardware: Mac (Intel) macOS 11
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-04-30 09:15 PDT by matthew
Modified: 2021-05-07 09:16 PDT (History)
3 users (show)

See Also:


Attachments
Screenshot of console error output from call to `navigator.credentials.create()` (26.13 KB, image/png)
2021-04-30 09:15 PDT, matthew
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description matthew 2021-04-30 09:15:55 PDT
Created attachment 427429 [details]
Screenshot of console error output from call to `navigator.credentials.create()`

It appears that Safari 14.1 (on macOS 11.3) no longer supports access to Touch ID when a MacBook is in clamshell mode. Attempts to call `navigator.credentials.create()` while specifying "platform" in authenticator selection fail with the following console message:

> Unhandled Promise Rejection: NotAllowedError: This request has been cancelled by the user.
The confusion comes from the fact that the user is never shown any UI to interact with; the request immediately errors out with no clue except for this single error message! It was only after some frantic testing that I discovered it was because the laptop was closed. When I opened the laptop then the same code worked as expected, with Safari prompting me to interact with Touch ID.

For sake of example here's what I'm passing in within attestation options to try and access Touch ID:

```
"authenticatorSelection": {
  "authenticatorAttachment": "platform",
  "requireResidentKey": false,
  "userVerification": "required"
}
```

Is it possible to clarify this error message to indicate that the request is erroring out because Touch ID is unavailable (for whatever reason)? It'll make it easier to debug this issue in the future as it'll be more obvious why seemingly functional code "stopped working for some reason".
Comment 1 Radar WebKit Bug Importer 2021-05-07 09:16:15 PDT
<rdar://problem/77658896>