Skip to content
This repository has been archived by the owner on Sep 14, 2021. It is now read-only.

TwilioDevEd/account-verification-servlets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Important Notice

For new development, we encourage you to use the Verify API instead of the Authy API. The Verify API is an evolution of the Authy API with continued support for SMS, voice, and email one-time passcodes, an improved developer experience and new features.

Please visit the Verify Quickstarts Page to get started with the Verify API. Thank you!

Account Verification with Servlets and Twilio

Build Status

When a new user signs up for your application, you want to make sure their contact information is accurate. You'd also like some assurance they are in fact a human being! You want to make sure that every new user account in your system is an actual person and not a robot.

There are many layers of security you can put in place to increase the quality of your signups, but one of the best is an account verification via SMS. Before a registration is fully completed, your application sends the user a one-time passcode via SMS. The user then enters the code on your website to complete their registration.

In this tutorial, you'll learn how to implement account verification at the point of registration using Twilio-powered Authy.

View the full tutorial here!

Local Development

This project is build using Java 8 and uses PostgreSQL as database.

  1. First clone this repository and cd into it.

    $ git clone git@github.com:TwilioDevEd/account-verification-servlets.git
    $ cd account-verification-servlets
  2. Copy the sample configuration file and edit it to match your configuration.

    $ cp .environment .env

    You can find your TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN in your Twilio Account Settings. You will also need a TWILIO_NUMBER, which you may find here. The AUTHY_API_KEY can be found here.

    Run source .env to export the environment variables.

  3. Create the database.

    $ createdb account_verification_servlets
  4. Execute the migrations.

    $ ./gradlew flywayMigrate
  5. Make sure the tests succeed.

    $ ./gradlew check
  6. Start the server(--debug flag optional, can be used to view request/response log).

    $ ./gradlew jettyRun --debug
  7. Check it out at http://localhost:8080.

Meta

  • No warranty expressed or implied. Software is as is. Diggity.
  • MIT License
  • Lovingly crafted by Twilio Developer Education.