I\'m wondering how these sms-registration mechanisms work. I searched on the internet, but the problem is there are so much sms-providers which want to sell online-sms servi
i know this post is too old, but this is for people that`ll visit this page in the future:
what the user "Harsh Shah" said is wrong..
you SHOULD NOT generate a random number on the device itself! this compromise the whole verification,
data exchange:
[phone reads the SMS eg as '123123']
on background: server: [check db for record user 01234567, compare the random number generated in step 1 with the number the user sent).
if you generate the number in the user phone, any script-kiddie can hack your authentication by extracting this number from the memory/storage (so easy to do) and spoofing an sms containing it (super easy to do as well)... you might think this is a rare case, but this is a major hole in the security, you can authenticate yourself as any existing user and steal data from them if you do it the way "Harsh Shah" said...
The basic fundamentals are :
There are many SMS gateway providers. You can search on google. Most of them also provide a tutorial for using their API in various programming languages. The cost is mostly based on per message and generally they are to be bought in the form of package of number of SMSes.
This article explains how to integrate sms verification to your android app just like whats App.
Android adding SMS Verification Like WhatsApp – Part 1
Android adding SMS Verification Like WhatsApp – Part 2
Basically the following steps involves in verifying mobile number
First user mobile number will be sent to our server where new user row will be created.
Our server requests the SMS gateway for an sms to the mobile number with a verification code.
SMS gateway sends an SMS to the user device with the verification code.
The verification code will be sent back our server again for verification. Our server verifies it and activates the user.
Here's a simple phone number verification service built on top of Nexmo (disclaimer, I do a little developer evangelism for Nexmo). I think it's basically what you're looking for, the goal is to verify that a number actually belongs to a user (could also be used for 2nd factor authentication).
The basic integration for a mobile app (specifically for this example code, but a common flow):
You can drop out the hosted portion, and just take those steps inside your application (generate a code, send via a SMS API, check the code the user enters). However, there are a few things to consider at that point:
Both of those issues are solved by putting the verification system outside the mobile application.