Add Two Factor Authentication to your app
Two factor authentication allows you to authenticate a user using their phone number.
- The first time the user opens the app they are prompted to enter their phone number
- They are then sent an SMS with a confirmation code
- They enter the confirmation code to verify that they are the true owner of the number
- They are now authenticated with the app
This SDK provides both the user interface for iOS and a back end server to send the SMS (powered by Twilio) and keep track of registered users. It's very easy to setup and handles the cases if a user loses their phone or if they change number.
The iOS SDK
The iOS SDK provides a complete user interface to manage the authentication process. All the code is localized which makes it easy to support different languages and it's packaged inside a Cocoa Pod which means that the module can be added to your project in minutes.
When your app loads up you just need to display the verify view controller. When verification is complete, you will recieve a callback with the authentication token allowing you to authenticate with your server.
The two factor authentication server is written in PHP using the Symfony 2 framework. It provides a REST API that the app uses for the two factor authentication process.
This API allows the app to request a new comfirmation code and to validate if a code is correct.
The server also stores a database of users which means that if user changes their phone number or loses their phone, their account isn't lost.
By default the server will generate a new Firebase token based on the user's ID. However, the server can easily be modified to provide an authentication token of your choice.
The package include a detailed document that explains how to setup both the server and the iOS code. If you have any further problems we have someone online 24 hours a day to assist you.