GregBaugues / authy2fa-servlets

Authy Two-Factor Authentication implemented in Java Servlets.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Two-Factor Authentication with Authy and Servlets

Build Status

This example application demonstrates how to use Authy as the two-factor authentication provider using Servlets.

Local Development

  1. First clone this repository:

    $ git clone git@github.com:TwilioDevEd/authy2fa-servlets.git
    $ cd authy2fa-servlets
  2. Create the database.

    $ createdb authy2fa

    The application uses PostgreSQL as the persistence layer. If you don't have it already, you should install it. The easiest way is by using Postgres.app.

  3. Edit the sample configuration file .env.example to match your configuration.

    Once you have edited the .env.example file, if you are using a UNIX operating system, just use the source command to load the variables into your environment:

    $ source .env.example

    If you are using a different operating system, make sure that all the variables from the .env.example file are loaded into your environment.

  4. Execute the migrations.

    $ mvn compile flyway:migrate
  5. Run the application.

    $ mvn compile jetty:run
  6. Check it out at http://localhost:8080

  7. To enable Authy OneTouch to use the callback endpoint you exposed, your development server will need to be publicly accessible. We recommend using ngrok to solve this problem.

    $ ngrok http 8080

About

Authy Two-Factor Authentication implemented in Java Servlets.


Languages

Language:Java 95.8%Language:JavaScript 1.7%Language:HTML 1.5%Language:CSS 1.0%