Skip to content

A POC for how to implement 2FA using TypingDNA Verify and Symfony

Notifications You must be signed in to change notification settings

mchojrin/TypingDNA-2fa

Repository files navigation

Symfony 2FA using TypingDNA

This repository is the code accompanying this article. It is designed as a Proof Of Concept to show how to integrate TypingDNA verify to an existing Symfony application.

Pre-requisites

In order to install and run this application you'll need:

Installing

  1. Clone this repository
  2. Copy the file .env to .env.local
  3. Add the following to the end of .env.local:
###TypingDNA

TYPING_DNA_CLIENT_ID=YOUR_CLIENT_ID
TYPING_DNA_APP_ID=YOUR_APP_ID
TYPING_DNA_CLIENT_SECRET=YOUR_CLIENT_SECRET
  1. Run the command docker-compose build
  2. Install composer dependencies: docker-compose exec php composer install
  3. Create the database: docker-compose exec php symfony console doctrine:schema:create
  4. Create a new user:
    1. Open the file app/src/DataFixtures/UserFixtures.php
    2. Change lines 23-25 to match your own information (Pay special attention to the phone number which must start with 00, then country code, then local number).
    3. Load fixtures: docker-compose exec php symfony console doctrine:fixtures:load -q

Running

  1. Start the services: docker-compose up -d
  2. Start a ngrok tunnel to localhost: ngrok http 8080. You should see a screen like:

Ngrok tunnel information

  1. Update the integration information on your TypingDNA Verify's dashboard
  2. Open a browser at the https endpoint created by ngrok /login. You should see this screen:

Login Screen

  1. Enter your credentials
  2. Submit the form. You should see this screen:

Login Screen

  1. Press the button "Verify with Typingdna"
  2. Complete verification process. You should end up on a screen similar to:

User Dashboard

That's it!

Now, if you try logging out and entering directly to /dashboard you'll be redirected back to the login screen.

About

A POC for how to implement 2FA using TypingDNA Verify and Symfony

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published