Bug 219823 - [WebAuthn][iOS] Turn on modern WebAuthn for default browsers
Summary: [WebAuthn][iOS] Turn on modern WebAuthn for default browsers
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: Jiewen Tan
URL:
Keywords: InRadar
: 220559 (view as bug list)
Depends on:
Blocks: 181943
  Show dependency treegraph
 
Reported: 2020-12-11 22:18 PST by Jiewen Tan
Modified: 2021-01-13 15:14 PST (History)
5 users (show)

See Also:


Attachments
Patch (6.46 KB, patch)
2020-12-11 22:29 PST, Jiewen Tan
no flags Details | Formatted Diff | Diff
Patch (42.39 KB, patch)
2020-12-12 14:25 PST, Jiewen Tan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jiewen Tan 2020-12-11 22:18:37 PST
Turn on modern WebAuthn for default browsers.
Comment 1 Radar WebKit Bug Importer 2020-12-11 22:18:57 PST
<rdar://problem/72250436>
Comment 2 Jiewen Tan 2020-12-11 22:29:44 PST
Created attachment 416093 [details]
Patch
Comment 3 Jiewen Tan 2020-12-12 14:25:54 PST
Created attachment 416109 [details]
Patch
Comment 4 Brent Fulgham 2020-12-12 17:44:22 PST
Comment on attachment 416109 [details]
Patch

R=me
Comment 5 EWS 2020-12-12 17:58:39 PST
Committed r270743: <https://trac.webkit.org/changeset/270743>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 416109 [details].
Comment 6 Jiewen Tan 2020-12-16 17:34:35 PST
A build fix:
Committed r270917: <https://trac.webkit.org/changeset/270917>.
Comment 7 Sam Weinig 2020-12-19 10:57:07 PST
Comment on attachment 416109 [details]
Patch

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

> Source/WebKit/WebProcess/WebPage/WebPage.cpp:3845
> +#if ENABLE(WEB_AUTHN) && PLATFORM(IOS)
> +    if (auto* connection = WebProcess::singleton().parentProcessConnection()) {
> +        if (isParentProcessAFullWebBrowser(connection->getAuditToken()))
> +            settings.setWebAuthenticationEnabled(true);
> +    }
> +#endif

This will break some invariants assumed by WebCore::Settings since the "WebAuthenticationEnabled" setting is set as being automatically bound to Settings. This is seen by the fact that in WebPreferencesExpermental.yaml, WebAuthenticationEnabled does not have webcoreBinding: custom or webcoreBinding:  none set.

If you want custom setting behavior, you will need to change WebPreferencesExpermental.yaml and always set the value manually.

That said, I think this is probably not really your intended behavior, since this will make it so that you can not disable feature when isParentProcessAFullWebBrowser() is true, which will break WKPreferencesSetWebAuthenticationEnabled as well as the testing SPIs.
Comment 8 Jiewen Tan 2020-12-21 16:06:40 PST
(In reply to Sam Weinig from comment #7)
> Comment on attachment 416109 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=416109&action=review
> 
> > Source/WebKit/WebProcess/WebPage/WebPage.cpp:3845
> > +#if ENABLE(WEB_AUTHN) && PLATFORM(IOS)
> > +    if (auto* connection = WebProcess::singleton().parentProcessConnection()) {
> > +        if (isParentProcessAFullWebBrowser(connection->getAuditToken()))
> > +            settings.setWebAuthenticationEnabled(true);
> > +    }
> > +#endif
> 
> This will break some invariants assumed by WebCore::Settings since the
> "WebAuthenticationEnabled" setting is set as being automatically bound to
> Settings. This is seen by the fact that in WebPreferencesExpermental.yaml,
> WebAuthenticationEnabled does not have webcoreBinding: custom or
> webcoreBinding:  none set.
> 
> If you want custom setting behavior, you will need to change
> WebPreferencesExpermental.yaml and always set the value manually.
> 
> That said, I think this is probably not really your intended behavior, since
> this will make it so that you can not disable feature when
> isParentProcessAFullWebBrowser() is true, which will break
> WKPreferencesSetWebAuthenticationEnabled as well as the testing SPIs.

Oops! Let me fixed that then.
Comment 9 Jiewen Tan 2021-01-13 15:14:50 PST
*** Bug 220559 has been marked as a duplicate of this bug. ***