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.
In order to install and run this application you'll need:
- Clone this repository
- Copy the file
.env
to.env.local
- 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
- Run the command
docker-compose build
- Install composer dependencies:
docker-compose exec php composer install
- Create the database:
docker-compose exec php symfony console doctrine:schema:create
- Create a new user:
- Open the file app/src/DataFixtures/UserFixtures.php
- 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).
- Load fixtures:
docker-compose exec php symfony console doctrine:fixtures:load -q
- Start the services:
docker-compose up -d
- Start a ngrok tunnel to localhost:
ngrok http 8080
. You should see a screen like:
- Update the integration information on your TypingDNA Verify's dashboard
- Open a browser at the https endpoint created by ngrok /login. You should see this screen:
- Enter your credentials
- Submit the form. You should see this screen:
- Press the button "Verify with Typingdna"
- Complete verification process. You should end up on a screen similar to:
That's it!
Now, if you try logging out and entering directly to /dashboard you'll be redirected back to the login screen.