Version 2 of the Verify API is now available! V2 has an improved developer experience and new features. Some of the features of the V2 API include:
- PSD2 Secure Customer Authentication Support
- Improved Visibility and Insights
You are currently viewing Version 1. V1 of the API will be maintained for the time being, but any new features and development will be on Version 2. We encourage you to do any new development with API V2. Check out the Java Verify V2 Quickstart for more information.
Phone Verification is an important, high-confidence step in a registration flow to verify that a user has the device they claim to have. Adding Twilio Verify phone verification to your application will greatly reduce your number of fraudulent registrations and protect future application users from having their numbers registered by scammers.
This quickstart guides you through creating a Java, Spring and AngularJS app that requires a phone verification step to create an account. Two channels of phone verification are demoed: SMS and Voice.
Ready to add Twilio Verify to a demo app and keep the bad actors away? Enter stage left!
Once logged in, visit the Authy Console. Click on the red 'Create New Aplication' (or big red plus ('+') if you already created one) to create a new Authy application then name it something memorable.
Twilio will redirect you to the Settings page next:
Click the eyeball icon to reveal your Production API Key, and copy it somewhere safe. You will use the API Key during the application setup step below.
Start by cloning our Spring repository. Enter the directory and use npm to install all of our dependencies:
- Open the file
ACCOUNT_SECURITY_API_KEYto the API Key from the above step
- Now, save the file as
- Source or otherwise set the environment variable in your environment
And that's all the setup you'll need!
Now, launch the application with:
Assuming your API Key is correctly entered you'll soon get a message that the app is up!
Keeping your phone at your side, vist the phone verification page of the demo at http://localhost:8080/verification/
Country Code and
Phone Number, then choose which channel to request verification over, 'SMS' or 'CALL' (Voice). Finally, hit the blue 'Request Verification' button and wait.
You won't be waiting long - you'll either receive a phone call or an SMS with the verification token. If you requested a phone call, as an additional security feature you may need to interact to proceed (by entering a number on the phone keypad).
Either way you requested the passcode, enter the token into the Verification entry form and click 'Verify Phone':
And with that, your demo app is protected with Twilio's Verify! You can now log out to try the other channel.
Your demo app is now keeping hordes of fraudulent users from registering with your business and polluting the database. Next, check out all of the variables and options available to you in the Verify API Reference. Also, for protecting your customers in an ongoing manner (with this same codebase) try the Java Spring Authy Two-Factor Authentication Quickstart.
After that, take a stroll through the Docs for more Account Security demos and tutorials - as well as sample web applications using all of Twilio's products.