This is an archived repository. If you have any questions, feel free to reach out to us at devrel@vonage.com or through our Community Slack at https://developer.vonage.com/community/slack.
This is the source code to accompany the How to Add Two-Factor Authentication with Java and Spark blog post
- Clone the repository
- Replace
YOUR_API_KEYandYOUR_API_SECRETinsrc/main/java/two/factor/auth/App.javawith your own Nexmo API key and secret from the Developer Dashboard - Execute
gradle run
- Visit
http://localhost:3000in your browser - Enter your cell phone number with the international dialing code but omit the
+symbol and any leading zeros - Press the Register button. In a moment or two you should receive a verification code via SMS.
- Enter the verification code and press Check.
- If you have entered the code successfully, you should receive a message that reads "Registration successful". If not, you will receive a message that reads "Verification failed".