Verify User Registrations with Symfony
Vonage's Verify API is used to implement multi-factor authentication with a two-step registration process for users, ensuring that only verified contact information is accepted. The tutorial extends an existing user authentication system in Symfony 5, adding phone number verification using the Vonage Verify API to confirm that the provided phone number belongs to the user and is valid for the region (country code) specified. The process includes creating a new entity with additional properties to store the country code and verification request ID, as well as implementing form fields to collect phone numbers, countries, and verification codes. A new utility class, `VonageUtil`, handles API interactions and verifies user input before sending a verification call using the Verify API. The tutorial also includes an event subscriber that checks if users are verified before allowing access to secured pages, redirecting them back to the verify form if necessary. The finished code for this tutorial is available in the end-tutorial branch of the GitHub repository.
Company
Vonage
Date published
April 19, 2021
Author(s)
Greg Holmes
Word count
2751
Language
English
Hacker News points
None found.