How to add Silent Network Authentication to your application
Time to read: 2 minutes
Silent Network Authentication (SNA) is a new way of verifying users with their mobile carriers without requiring any user input. This authentication method uses GSM authentication under the hood to provide strong security assurance without the added friction of entering a one-time passcode or downloading a special authentication app.
The basic user experience looks like this: the user enters their phone number, the application performs the authentication in the background and verifies the user without any additional passcodes or other input.
Learn more about how SNA works on the blog or start using the API by following the tutorial below.
Prerequisites for building with Silent Network Authentication
To follow along with this tutorial you will need to:
- Sign up for or sign in to your Twilio account.
- Request access to the API and Live Test Number feature (24 hour turnaround).
- Add your personal phone number in the console for testing (see supported carriers).
- Create a Verify Service in the Twilio Console.
How to verify users with SNA
There are 3 main steps to verifying users with SNA:
- Start the verification process
- Invoke the
sna.url
on a mobile device. This is the key feature of SNA that activates the background verification by talking directly to the mobile carrier. - Check the verification status
Step 1: start the verification process to get the sna.url
Replace the phone number in the To
parameter with your personal phone number for testing (see supported carriers). This is the same API you would use to send an SMS, WhatsApp, or email verification.
Grab the nested sna.url
from the response:
Step 2: invoke the sna.url
from a mobile device
Because SNA uses network authentication, disconnect from Wi-Fi before invoking the URL from a mobile browser.
For testing purposes, send yourself the sna.url
via email or something like AirDrop then click on the link from your mobile device. You should see ErrorCode=0
in the browser.
Step 3: check the verification
Finally, check the status of the verification with the following command. If the network authentication was successful, the status will be "approved".
This API request will generate a response that looks like the following. Note the approved status
. If the status is still pending the verification was unsuccessful.
If the verification status
is approved, you can proceed to log in the user, validate a transaction, or complete whatever other trusted process you were gating with the verification process.
SNA error handling
Always check the error code on the API response at each step. SNA errors begin with 605xx and will be available at the check verification step. Check out the documentation for more error handling guidance. In general, you can failover to SMS OTP for all error codes except 60540.
How to take SNA into production
Once you've tested SNA you'll want to start the carrier approval process in order to make requests on customer data - this is required by carriers in order to query the real-time connectivity information that powers SNA behind the scenes. Reach out to our sales team if you have any questions about this process.
Then, check out the best practices for SNA guide for more information on how to handle implementation details, do error handling, manage edge cases, and scale the solution globally.
Like any verification solution, you will want to consider backup channels. The multi-channel Verify API has you covered with SMS, WhatsApp, Email, Push, and more. I can't wait to see what you build and secure!
Related Posts
Related Resources
Twilio Docs
From APIs to SDKs to sample apps
API reference documentation, SDKs, helper libraries, quickstarts, and tutorials for your language and platform.
Resource Center
The latest ebooks, industry reports, and webinars
Learn from customer engagement experts to improve your own communication.
Ahoy
Twilio's developer community hub
Best practices, code samples, and inspiration to build communications and digital engagement experiences.