GithubHelp home page GithubHelp logo

Comments (4)

tiwarishubham635 avatar tiwarishubham635 commented on September 8, 2024

It works correctly for me though. Can you re-check once?

from twilio-node.

tiwarishubham635 avatar tiwarishubham635 commented on September 8, 2024

Just to be on the same page, I followed these steps:

  1. I created a service from here and stored the Service SID in variable serviceSid
  2. Next, I created an entity using this code snippet:
const identity = 'user-identity';
client.verify.v2.services(serviceSid)
             .entities
             .create({
                 identity: identity
             })
             .then(entity => console.log(entity));
  1. Then I created a new TOTP factor using this:
client.verify.v2.services(serviceSid)
    .entities(identity)
    .newFactors
    .create({
        friendlyName: `Name`,
        factorType: 'totp'
    })
    .then(new_factor => console.log(new_factor));
  1. I saved the value of new_factor.sid in factorSid and used new_factor.binding.uri to create QR code using this.
  2. Scanned this QR code and saved the key in my phone.
  3. Then used the following code snippet for verification:
const totpCode = '123456'
client.verify.v2.services(serviceSid)
    .entities(identity)
    .factors(factorSid)
    .update({authPayload: totpCode})
    .then(factor => console.log(factor));
  1. The status shows verified for me

Let me know if I am doing something different but it works fine for me. Thanks!

from twilio-node.

yifanplanet avatar yifanplanet commented on September 8, 2024

Sorry that was a mistake on my side. Thanks so much for detailed steps for the implementation.
One question: Is the entity create step necessary for the factor verification?

from twilio-node.

tiwarishubham635 avatar tiwarishubham635 commented on September 8, 2024

Nope, it is not necessary. I just created it to see if that os creating a problem for you.

from twilio-node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.