-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow Conditional Mediation without autofill #2144
Comments
Would it be reasonable to suggest this is loosely akin to the FedCM experience? |
Yes, albeit with the important qualifier that this would only appear if the user has existing credentials for the site. It would not appear otherwise, while FedCM can. |
Is there a desire to support display of both the autofill UI as well as "ambient" UI at the same time? If it would be best for this to be either/or, what if an RP opted into ambient display by omitting the https://w3c.github.io/webauthn/#GetAssn-ConditionalMediation-Interact-FormControl That is to say, if an RP doesn't specify |
I would worry about races where the DOM elements are constructed by Javascript after page load, but the browser has already looked and decided that there weren't any. |
Related to @MasterKale's comment: I agree this seems like this would be better expressed as new One possible issue could be that this might interfere with the last paragraph:
But maybe that could be addressed by calling the option value something like |
I was preferring to add it to For your concern about clarity, would it help if the new field was named |
Hm, is that because
No need, the clarity concern was specifically about |
I don't think |
RP perspective: Agreed @nsatragno, and I'll add that a new mediation option is going to add a lot of complexity on the implementing site side as well - more feature detection and conditionally setting the value based on the results (which could expand to the backend depending on setup, not just pure client code). It would be really easy to break an auth flow if you don't get it just right. Adding a field into the PK dictionary seems sensible - though I'll suggest making it an array of preferences rather than a single value, and browsers should use the first supported entry, and fall back to their current behavior (based on e.g. you might want to express "use autofill if the correct input element exists, otherwise show the ambient display" (or vice-versa) {
"rp": {
"id": "exmple.com",
},
"display": ["autofill", "ambient"], // "modal" too?
// ...
} While I doubt there are a whole lot of other potential UIs to consider, if others are added in the future, you can safely add the value in the list and not worry about breaking other flows in browsers that don't yet support it. It might also be worth going down the list-of-objects path here (instead of list-of-strings) in case there are display customizations that these could support: For what it's worth, I also like @MasterKale 's suggestion of "just leave off the autocomplete details and let the browser decide" which is delightfully simple on the RP side (but yes, data races) |
|
@pascoej Are you suggesting that RPs could add this to pages in order to get conditional UI on arbitrary pages, without any changes to the spec? I'd be concerned that having autofill UI appear without visible input fields would be confusing to users. Chrome won't trigger autofill on a hidden field, and I think we'd be reluctant to consider changing that behaviour. |
@kenrb I took @pascoej's suggestion as a new way to set up a <!-- Regular Conditional UI -->
<form action="">
<input type="email" name="email" id="email" />
<input type="password" name="password" id="password" autocomplete="current-password webauthn">
</form> But the presence of <!-- New "Ambient" UI -->
<form action="">
<input type="email" name="email" id="email" />
<input type="password" name="password" id="password" autocomplete="current-password">
<input type="hidden" autocomplete="webauthn">
</form> Then I'd assume the exact same call to WebAuthn would get a response the same way: navigator.credentials.get({
mediation: 'conditional',
publicKey,
}).then(handleWebAuthnResp); |
I see, thanks for the clarification. What is the rationale for that? Is it easier for sites to add an element to the HTML than a field to the credential options? For implementers it would add some complexity, since the JS call handler won't know right away whether it will need to show the ambient UI, and we have to think about handling situations where that element is added to the document at an arbitrary point after page load. |
Couple of questions on this:
|
If an extension hooked
Still an open question. Since cross-domain iframes need to be given explicit permission to call WebAuthn by the parent frame, it might be reasonable to allow this. (I.e. perhaps some 3rd-party authentication service would work like that.) But I can also see the argument that the UI is linked to the main frame and thus shouldn't apply in that case. |
Appreciate the clarifications! From Shopify's unique perspective, being able to trigger ambientUI in the top frame from a x-domain iframe would be key to take advantage of this proposed feature |
Forgetting the current autocomplete=webauthn token is a common failure case for using conditional mediation, especially during early development. Thinking on it more, I'd suggest simplifying this whole concept further, and default to the proposed ambient UI for all conditional requests unless the input field is present (in which case it'll use the existing UIs that are attached to the input field). A well-formed call to
I could see the possibility of hiding the ambient UI and switching to the autofill one if an appropriate |
This is not intended for level 3.
Proposed Change
I have added an explainer to the wiki proposing a new UI mechanism and a way for sites to trigger it. The motivation is to provide conditional UI functionality that is not tied to autofill, so it can be used to sign in to an RP without necessarily being on a dedicated sign-in page.
As with existing conditional UI, the user agent would ignore the request if there are no eligible credentials for the current RP.
At Google we have been tentatively labeling this "ambient UI", reflecting that we are imagining an unobtrusive non-modal UI surface that can be ignored by the user.
The text was updated successfully, but these errors were encountered: