My Mobile verification system is powered by Twilio. Twilio's npm package is available for Node.js app,which can be utilized for sending messages and voice calls.
- Free account generates a Twilio number which can send messages and voice calls only to the numbers that have been verified by Twilio.
- If you want to send message to any random number, then you need to purchase a premium Twilio number.
- Associate your twilio account with Authy.
- Authy is a 2way authentication method, whose packages are available for Node app.
- Authy sends OTP in the requested number, using Twilio messeges.
- Waits for the user to send the OTP back to the server for verification, and sets time limit at the same time.
- If the message dies, then there is option for Resend.
- Else the account is verified and the user is stored in the database as verified user.
The OTP entered is sent back to the server, where it is verified. If the users exceeds the time-limit of sending the OTP back, then the OTP dies and the user has to request another OTP.
1. Download the code.
2. Npm init and install all packages.
3. Insert Twilio ssid, account_id, and authy key.
4. Run Mongodb/ insert MLabs Uri.
5. nodemon server.js