首页 > 解决方案 > 使用 Auth0 无密码语音代替短信

问题描述

我已经可以使用短信,但我需要提供通过电话接收验证码的选项,可以吗?谢谢!

标签: twilioauth0

解决方案


Twilio Developer Evangelist here! You can use our Phone Verification API and then pass in the channel ('sms' or 'call') as a parameter like so:

// npm install authy
const authy = require("authy")("YOUR_AUTHY_API_KEY");

authy
  .phones()
  .verification_start("5551234567", "1", "sms", function(err, res) {
    if (err) {
      console.log(err);
    }

    console.log(res.message);
  });

Here's the full QuickStart: https://www.twilio.com/docs/verify/quickstart/nodejs


推荐阅读