One-Time Passcode Verification (OTP)
One-Time Passcode Verification (OTP)
1.0.10
Vonage
NodeJS
Use the Vonage Verify API to send a One-Time Passcode to a given phone number for verification.
The Vonage Verify API enables you to confirm that you can contact a user at a specific number, so that you can:
- Reach your users at any time, by ensuring that you have their correct phone number
- Protect against fraud and spam, by preventing one user from creating multiple accounts
- Add an extra layer of security to help confirm a user's identity when they want to perform certain activities
In this project, you’ll use the Verify API to send a One-Time Passcode to a given phone number. That phone number will then receive a text message containing a code which is entered into the application for successful verification. This project uses Vonage Cloud Runtime, removing the need to manage servers and hosting. Visit the developer portal to view documentation on how it works.
Steps
-
To start, ensure you are signed into your Vonage developer account. If you do not have an account yet, you can create one here.
-
To immediately deploy the application, go to the ‘Deploy Code’ tab. Enter a name for your application in ‘Instance Name’, select your AWS region, and click the ‘Deploy Code’ button.
- You will see a pop up prompting you to enter your Vonage API Secret - you can find your secret in the developer dashboard settings. Click continue to create the application.
- You will then see your new application under ‘Deployed Instances’. Click ‘Launch’ to run it and enter a phone number for verification.
- The given phone number will then receive a code to enter for successful verification.
-
To view the code and edit the application, go to ‘Get Code’ and click ‘Create a new development environment’.
- You will see a pop up prompting you to enter a workspace name and your Vonage API Secret - you can find your secret in the developer dashboard settings. Click continue to launch the workspace.
- When the workspace opens, you will see a README detailing how to edit, debug, run and deploy the project.
- Once your project is deployed, you can use the URL in the terminal output to access your application.