简体   繁体   English

Twilio 双重身份验证 Model 为 Web

[英]Twilio Two Factor Authentication Model for Web

I've got a system setup to send a 2FA code that I generate at login to a users cell phone, the basics work fine.我有一个系统设置,可以将我在登录时生成的 2FA 代码发送到用户手机,基本功能正常。 User logs in, they get an automatic SMS message with the code, cool...BUT, I want to enable the "AutoFill" options that I see on my computer via my iPhone when I login to other 2FA systems.用户登录后,他们会收到一条带有代码的自动 SMS 消息,太棒了……但是,当我登录到其他 2FA 系统时,我想启用通过我的 iPhone 在我的计算机上看到的“自动填充”选项。

I'm assuming there's something else that I need to code into my SMS message to give the option of "AutoFill" from my phone...but I don't know what it is.我假设我还需要将其他内容编码到我的 SMS 消息中,以便从我的手机中选择“自动填充”……但我不知道它是什么。 I saw a random blog that said you can just include @example.com 123456 (domain name and code) as the last line of the SMS message, but when I do that, it just includes that as text in the SMS...我看到一个随机的博客说你可以将@example.com 123456(域名和代码)作为短信的最后一行,但是当我这样做时,它只是将其作为文本包含在短信中......

Any ideas on what I'm missing?关于我所缺少的任何想法?

Check out this blog post .查看这篇博文

In iOS and Safari on macOS we can take advantage of this to have the browser suggest two factor authentication codes that are sent to the device over SMS.在 macOS 上的 iOS 和 Safari 中,我们可以利用这一点让浏览器建议通过短信发送到设备的双因素身份验证代码。 Adding the autocomplete attribute with the value "one-time-code" will trigger this behaviour.添加值为“一次性代码”的自动完成属性将触发此行为。

<input
  type="text"
  name="token"
  id="token"
  inputmode="numeric"
  pattern="[0-9]*"
  autocomplete="one-time-code"
/>

For a Chrome solution,对于 Chrome 解决方案,

the Chrome team is investigating similar ideas to streamline this process. Chrome 团队正在研究类似的想法来简化这个过程。 Currently there is an experiment with an imperative SMS Receiver API modelled on Android's SMS receiver API. This would allow developers to extract the one time password from the SMS and, because it's in JavaScript, instantly submit the form, saving the user more time.目前有一个基于 Android 短信接收器 API 的命令式短信接收器 API 的实验。这将允许开发人员从短信中提取一次性密码,因为它在 JavaScript 中,立即提交表单,为用户节省更多时间。

At the time of writing this API is part of an origin trial which allows you to test it out and feed back to the Chrome team.在撰写本文时,此 API 是原始试用版的一部分,您可以对其进行测试并反馈给 Chrome 团队。 If this interests you, sign up and give the API a whirl.如果您对此感兴趣,请注册并试一试 API。

Well, the blog post was made in 2020 and since then the Trial is complete.好吧,这篇博文是在 2020 年发表的,从那以后试用就完成了。 You can find more details here .您可以在此处找到更多详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM