Bug 240038 - [WebAuthn] Remove user gesture requirement for mediation=conditional assertions
Summary: [WebAuthn] Remove user gesture requirement for mediation=conditional assertions
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: pascoe@apple.com
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-05-03 14:07 PDT by pascoe@apple.com
Modified: 2022-05-04 13:29 PDT (History)
2 users (show)

See Also:


Attachments
Patch (3.48 KB, patch)
2022-05-03 14:09 PDT, pascoe@apple.com
no flags Details | Formatted Diff | Diff
Patch for landing (3.39 KB, patch)
2022-05-03 14:42 PDT, pascoe@apple.com
no flags Details | Formatted Diff | Diff
Patch for landing (3.38 KB, patch)
2022-05-04 10:59 PDT, pascoe@apple.com
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description pascoe@apple.com 2022-05-03 14:07:20 PDT
Conditional assertions are non-modal and already require a gesture to complete via
a different mechanism. So if conditional mediation is available on the platform and
requested, we should not require a gesture.
Comment 1 pascoe@apple.com 2022-05-03 14:07:28 PDT
rdar://92137603
Comment 2 pascoe@apple.com 2022-05-03 14:09:58 PDT
Created attachment 458756 [details]
Patch
Comment 3 Brent Fulgham 2022-05-03 14:34:31 PDT
Comment on attachment 458756 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=458756&action=review

r=me, but please check the cause of the debug failure.

> Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm:326
> +            requestContext.get().requestStyle = ASCredentialRequestStyleAutoFill;

Nit: I'd prefer to check and do an early return if it does NOT respond to the selector, rather than this form. It's slightly easier to read and a little more concise.

> Source/WebKit/UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp:110
> +    if (!data.processingUserGesture && !m_webPageProxy.websiteDataStore().authenticatorManager().isVirtual() && data.mediation != MediationRequirement::Conditional)

Nit: It might be slightly more efficient to test the 'data.mediation' condition before retrieving the websiteDataStore->authenticator and calling its isVirtual method.
Comment 4 pascoe@apple.com 2022-05-03 14:42:32 PDT
Created attachment 458758 [details]
Patch for landing
Comment 5 EWS 2022-05-04 10:54:43 PDT
ChangeLog entry in Source/WebKit/ChangeLog contains OOPS!.
Comment 6 pascoe@apple.com 2022-05-04 10:59:08 PDT
Created attachment 458812 [details]
Patch for landing
Comment 7 EWS 2022-05-04 13:29:53 PDT
Committed r293786 (250265@main): <https://commits.webkit.org/250265@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 458812 [details].