Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Verify user during signup by sending and receiving sms through Twilio

I am trying to verify user by sending sms through twilio (Android Application).

Here is the Detailed summary- (As in Snapchat) During signup i want to validate user by sending dynamic run-time code to user mobile. and after sending i have the verification field.

so what should i do ?

like image 605
dev_android Avatar asked Dec 25 '22 11:12

dev_android


1 Answers

Twilio employee here.

This is a really common use case for Twilio and plenty of apps do the "phone number verification" thing you're looking for.

Let me boil down the steps on how to do this in human form, as this is much easier to explain than writing a bunch of code:

  1. A user will type their phone number into a field to be verified.
  2. When the user has typed in their number, you can compute a unique code (4 - 6 digits is all you need) however you like, and then use our REST API to send the number they entered the code.
  3. At this point, you should save the unique code so you can reference it later.
  4. Prompt the user to enter the code into a field within your app.
  5. Compare the entered code to unique number you stored them and viola!

If the code is the same: you know that they own the phone number that you sent the message to. A very similar process is described in this 2-factor authentication how-to.

I hope that makes sense.

If you have any questions, please ask.

like image 50
phalt Avatar answered Dec 28 '22 09:12

phalt