1) Create a Table with Mobile No/Email ID and user details and OTP columns'
2) Fill detail accordingly by registration form
3) Create services for get OTP
- Ask mobile number / Email address for OTP
- If mobile number/email address already exists update OTP column with random string as OTP
- Send OTP on Mobile/Email respestively
4) Create service for Login
- It needs mobile/email and OTP combination
- Check that combination if it is correct then do login else return messsage "invalid login"
You have to modify it according to your need, I have just provided idea.