twilio无法验证手机 您所在的位置:网站首页 twilio账号 twilio无法验证手机

twilio无法验证手机

2023-09-07 18:36| 来源: 网络整理| 查看: 265

twilio无法验证手机

There are various approaches used to confirm people are in fact who they say they: reference some aspect of the user herself (e.g. biometrics), ask for something the user knows (e.g. a password), or ask for something the user physically has (e.g. an RFID card). Traditional websites implement single-factor authentication, requiring just a user’s password. But multi-factor authentication on the other hand requires verification from at least two of the different approaches and is considerably more secure.

有多种方法可以用来确认人们实际上是在说他们是谁:参考用户本人的某些方面(例如生物特征识别),询问用户知道的内容(例如密码)或询问用户实际拥有的内容(例如RFID卡)。 传统网站执行单因素身份验证,仅需要用户密码。 但是另一方面,多因素身份验证需要至少两种不同方法的验证,并且安全性要高得多。

Using biometrics to authenticate someone to your website is probably still a long ways off with many technological hurdles and civil liberties concerns to overcome. A more practical approach to multi-factor authentication is to implement options from the other two categories, such as requiring a password and a confirmation token sent to the user via phone either by SMS or voice call (the user knows the password, and has a phone). This is what you’ll learn how to implement in this article.

使用生物识别技术对网站上的某人进行身份验证可能还有很长的路要走,要克服许多技术障碍和公民自由问题。 一种更实用的多因素身份验证方法是从其他两个类别中实现选项,例如要求输入密码和通过SMS或语音呼叫通过电话发送给用户的确认令牌(用户知道密码,并且具有电话)。 这就是您将在本文中学习的实现方法。

Telephony integration can be frustrating if you’re doing it from the ground up, and most of the time it’s not practical to build up your own infrastructure (though possible with commodity hardware and programs like Asterisk). Luckily, Twilio offers the infrastructure and an API which developers can use to write interactive telephony applications without much hassle. I’ll be making use of their services in this article.

如果您是从头开始的话,电话集成可能会令人沮丧,并且在大多数情况下,构建自己的基础结构是不切实际的(尽管可以使用商品硬件和程序,例如Asterisk )。 幸运的是, Twilio提供了基础结构和API,开发人员可以使用它们轻松编写交互式电话应用程序。 我将在本文中利用他们的服务。

You can make and receive phone calls and send and receive text messages with Twilio using TwiML (Twilio Markup Language) and their REST API. You can work directly with the API, or use one of the available helper libraries. The library I’ll use here is twilio-php, the library released and officially supported by Twilio.

您可以使用TwiML(Twilio标记语言)及其REST API使用Twilio拨打和接听电话以及收发短信。 您可以直接使用API​​,也可以使用可用的帮助程序库之一 。 我将在这里使用的库是twilio-php ,它是Twilio发布并正式支持的库。

So, are you ready to learn how you can implement multi-factor authentication? Read on!

那么,您准备好学习如何实现多因素身份验证了吗? 继续阅读!

从PHP使用Twilio (Using Twilio from PHP)

Connecting to the Twilio service is as easy as including the twilio-php library and creating a new instance of the Services_Twilio class. The object’s constructor accepts your account’s SID and auth token which are listed on your Twilio account’s dashboard page after you sign up for their service.

连接到Twilio服务就像包含twilio-php库并创建Services_Twilio类的新实例一样容易。 对象的构造函数接受您的帐户的SID和auth令牌,这些令牌在您注册Twilio帐户的仪表板页面后列出。

With an available Services_Twilio instance at your disposal, you can access their API though the account property. account exposes an instance of Services_Twilio_Rest_Account which represents your Twilio account. I’m only using one account here, but it is possible to have multiple sub-accounts. This can be useful for segmenting your interactions depending on your needs. You can learn more about sub-accounts by reading the Twilio documentation.

使用可用的Services_Twilio实例,您可以通过account属性访问其API。 帐户公开一个Services_Twilio_Rest_Account实例,该实例代表您的Twilio帐户。 我在这里只使用一个帐户,但是可以有多个子帐户。 这对于根据您的需求细分互动很有用。 您可以通过阅读Twilio文档来了解有关子帐户的更多信息。

Sorry. An error occurred.


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有