TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

HTML attributes to improve your users' two factor authentication experience

357 pointsby ecaronover 5 years ago

20 comments

mnoorenbergheover 5 years ago
&gt; You can use more than one autocomplete value at a time too. If your username is also an email address you can give the browser and any associated password managers a hint with ‘autocomplete=&quot;username email&quot;’.<p>This whole paragraph is incorrect. While the attribute value does allow multiple tokens there is a very specific syntax defined in the HTML standard and it doesn’t support multiple field names (types) i.e. autocomplete=&quot;username email&quot; is invalid. If you access ‘input.autocomplete’ on an input with that attribute value “” will be returned indicating this.
评论 #22025577 未加载
noodlesUKover 5 years ago
What this write up on 2fa is missing is that rather than using proprietary solutions like authy, we should be moving towards what we’ve now standardised as webauthn. If we had platform authenticators or we had a google&#x2F;apple first party implementation of something like Krypton, we would be in such a better place security wise.
stockkidover 5 years ago
&gt; In a sign up form, make sure to use the &quot;new-password&quot; value as it triggers password suggestions in some browsers.<p>Nice. I didn&#x27;t know about that.
cascaover 5 years ago
While Twilio does a lot right, they still only offer SMS and their own proprietary Authy solution for 2FA for their website. No TOTP (and still no plan to offer the industry standard) means that this has a whiff of hypocrisy.
评论 #22022970 未加载
评论 #22024069 未加载
ayberkover 5 years ago
These are all super nice and I really wish more developers made use of these, but my main complain is not having username and password fields on the same page :&#x2F;
评论 #22023254 未加载
评论 #22024111 未加载
评论 #22022824 未加载
评论 #22022811 未加载
philnashover 5 years ago
Hello! I’m the author of this article. Thanks for posting! Here’s to the power of HTML attributes and better sign in experiences for everyone.
评论 #22025331 未加载
评论 #22022669 未加载
0xff00ffeeover 5 years ago
The article is about how to improve a UI&#x2F;UX using lesser known HTML properties. The article does a great job: these tags are helpful and not everyone reads the spec for fun.<p>The article is NOT about the merits of 2FA across SMS: that discussion is happening in about 10,000 other threads on Hacker News. Please go talk about it there.
motohagiographyover 5 years ago
Dealing with 2FA ux right now. There is a massive gap between threat intel people, product owners, and end users.<p>From an identity assurance perspective, SMS is the best available. From an authentication perspective, it&#x27;s increasingly dodgy.<p>Reality is telcos have user enrollment almost on par with bank KYC, where everything else has great authN but with user asserted identity.<p>Critics of SMS are technically correct, but 9&#x2F;10x I don&#x27;t think they have had to solve identity in an open or federated environment.
评论 #22024940 未加载
amatixover 5 years ago
Authy’s iOS app still doesn’t have an actions&#x2F;app helper, so every time you need to switch to the home screen, find &amp; launch it, search for the site, close the keyboard (the copy button is obscured by it), hit copy, then switch back to Safari&#x2F;wherever and paste. So much friction.<p>Kind of implies the engineers who build it never ever use it?
skunkworkerover 5 years ago
I wish more sites would follow these protocols. When you have a numeric 2FA with a regular keyboard it feels less polished.
akerstenover 5 years ago
Is type supposed to be &quot;text&quot; instead of &quot;number&quot; in the inputmode snippet? Wouldn&#x27;t it still strip leading zeros the way it is now (with type set to &quot;number&quot;)?
评论 #22024536 未加载
评论 #22024391 未加载
daveFNbuckover 5 years ago
I didn&#x27;t know about the one-time-code autocomplete. How do they prevent this from being used to steal one-time passwords sent by other sites?
QuinnyPigover 5 years ago
I’d give a lot to be able to forcibly delete Authy-specific 2FA accounts from the app. Today I’m stuck with old dead account tokens.
tobyhinloopenover 5 years ago
Didn’t we just learn you shouldn’t use SMS 2FA?
评论 #22022525 未加载
评论 #22022675 未加载
评论 #22022536 未加载
评论 #22022686 未加载
评论 #22022628 未加载
gsichover 5 years ago
I want a one-step-login. Not two step (first username, then password) and certainly not three step (username, password, 2fa, all in seperate pages). This braindead concept needs to die.<p>If no 2fa is active on the account, just accept anything (including empty strings) in that field.
评论 #22025319 未加载
cyberferretover 5 years ago
This is a really cool and informative article. I had head of the &#x27;pattern&#x27; attribute before, but I hadn&#x27;t come across &#x27;inputmode&#x27; before. This will solve a ton of headaches for my future development work.
duxupover 5 years ago
If I&#x27;m doing verification I usually need more than&quot;pattern&quot; will allow, usually providing more feedback or something more complex.
homeroover 5 years ago
Twitter has the worst one where they don&#x27;t trim whitespace so pastes can fail. How hard is adding trim()
hk__2over 5 years ago
&gt; For older browsers there is another trick to trigger the numeric keyboard and include a bit of extra validation for free.<p>A simpler one that the pattern attribute, but more hacky-er, is using input type=&quot;tel&quot;, which I’ve also seen used for credit card number inputs.
notlukeskyover 5 years ago
SAASPASS has a much better 2FA user experience on the mobile phone than SMS including URL callback to the 2FA app and app to app with SDK. For desktop environments configurable MFA methods include scanning encrypted barcodes and push login. More on the developer environment is here:<p>developer.saaspass.com<p>I work for an IAM consultancy&#x2F;reseller and work on SAASPASS implementations.