-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
autocomplete=one-time-code underspecified #4586
Comments
I don't think I'm saying that browsers on Android can't auto-fill this at all. I'm saying that they can't autofill it without either:
On 2, Chrome (at least) is unlikely to ask for permission to read all of a user's SMS messages. On 1, Android has taken a different tack from iOS by implementing a lower-privilege SMS Retriever API, which waits for incoming messages that meet a certain application-specific template, and passes just those messages on to the relevant application. I think that latter approach is pretty interesting, as it creates the potential for browsers to add origin-specificity into the incoming SMS, which has the potential to mitigate phishing attacks (as the attacker could cause |
I think it is interesting to decouple (a) the server-side template that enables a browser from gathering SMSes without the overly permissive Here is an example of the type of server-side template that we are exploring that would preserve the privacy/security/abuse properties of native apps:
That is, I believe it is still possible to offer a declarative auto-fill API (viz Safari's) while still accomplishing (a). <input autocomplete='one-time-code'> Notably, another dimension that I think is worth factoring out, is (c) the UX mediation hops needed, which is where I think an imperative API can come in as a complementary API in (b). let {content} = await navigator.sms.receive(); Specifically, in terms of (b), a declarative autofill API requires browser mediation (through, obviously, the autofill consent UI to share For example, the Android SMS Retriever API has addressed a variety of privacy, security and abuse vectors which enabled them to allow native apps to access SMS OTPs without any user consent/mediation (e.g. when you sign up on native apps SMSes get verified automatically with no user interaction), and that's the kinda of user-benefit that we are hoping we can bring to Web users (in addition to, rather than in spite of, a declarative autofill API). Does that make sense? |
What's not really clear to me is to what extent Android's approach to this problem is favorable to iOS. It seems if anything we want folks to migrate away from SMS long term, right? |
FWIW, SMS isn't the only delivery mechanism for one-time passwords so I don't think defining how to use SMS to autofill the value should be a requirement for this specification. For example, some password managers have built-in TOTP clients that could fill their value into the field. Having the hint that a field is for a one-time-code makes this much easier for agents helping the user compared to |
Given that it does appear to be implementable on Android without having to access all the SMSs, and given the user convince and popularity of this method, might be "worth prototyping"? |
Does anybody know how this is actually implemented in Safari, today? What SMS message formats trigger the autofill suggestion? Educated guess: Is it just equivalent to the existing
Presumably this varies per locale.. The spec, and documentation on this are next to non-existent. Edit: this appears to function even if you don't use the |
Safari heuristically guesses what might be a one-time code field when the right autocomplete value isn't present, just as for all other autofill fields. Safari guesses that a wide range of SMS formats signal a one-time code, and has a user action before filling (via UI in the OS keyboard on iOS, via browser UI on macOS). There seems to be a lot of agreement on the format in https://wicg.github.io/sms-one-time-codes/ , so that's probably what should be recommended for authors, while perhaps still allowing browsers to parse legacy formats if they should choose to. |
My day job utilizes OTP as first-factor authentication, whether or not that's a good idea isn't up for discussion :) For the sake of others in the same position I'd recommend having wording in the specification that implementations of input fields with the As all major browsers ignore |
Following up from #3745 (comment), the
autocomplete=one-time-code
specification doesn't tell a website author enough to know how they should send an SMS that'll actually autofill on the user's platform. Do they need to user-agent-sniff to get the right format on iOS vs Android? Is @mikewest right in #3745 (comment) that browsers on Android can't auto-fill this at all?The text was updated successfully, but these errors were encountered: