Closed Jorgu5 closed 1 year ago
Interesting development, I wouldn't expect it to matter since the WebAuthn spec doesn't mandate the autofill tokens be in any specific order:
If options.mediation is conditional and the user interacts with an input or textarea form control with an autocomplete attribute whose value contains a "webauthn" autofill detail token,
https://w3c.github.io/webauthn/#GetAssn-ConditionalMediation-Interact-FormControl
I tried recreating in Chrome Beta 188, here's what I observed:
autocomplete="webauthn"
: autofill appearedautocomplete="username webauthn"
: autofill appearedautocomplete="webauthn username"
: autofill did not appearWould you consider logging this as an issue with the Chromium project instead? I think this should really be tackled there. Either way I'll bring this up with some Google people I'm in touch with and see what they think too.
Hello @Jorgu5, I've asked around and it turns out there is a specific order for the tokens, it's just specified in WHATWG instead:
https://html.spec.whatwg.org/#autofill-detail-tokens
The "webauthn"
token is #4, after #2 which is the typical "username"
or "password"
tokens. Which means only the following orders should be correct:
I'll have to tweak the detection logic in startAuthentication()
accordingly.
BTW I also created an issue in the WebAuthn spec related to this, as I think this should be something that could be understood just by reading the WebAuthn spec:
The newly-published @simplewebauthn/browser@8.3.1 will now require that the "webauthn"
autocomplete value be either the only value, or the last value when multiple tokens are present ✌️
I also updated the docs accordingly:
https://simplewebauthn.dev/docs/packages/browser#browser-autofill-aka-conditional-ui
Describe the issue
Per the SimpleWebAuthn documentation for enabling conditional UI, the autocomplete input attribute should work regardless of the order in which "webauthn" is placed. Whether it's "username webauthn" or "webauthn username," it should function correctly. However, this isn't the case with Chrome across all versions. I spent an entire day deep-diving into debugging this issue, only to find it works as expected on Safari but not on Chrome.
Reproduction Steps
Expected behavior
The conditional UI should operate flawlessly regardless of whether "webauthn" precedes or follows "username" in the autocomplete attribute.
Dependencies
SimpleWebAuthn Libraries