Skip to content

ChatPost08/account-security-quickstart-php

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twilio

Twilio Account Security Quickstart - Two-Factor Authentication and Phone Verification

A simple PHP, Laravel and AngularJS implementation of a website that uses Twilio Account Security services to protect all assets within a folder. Additionally, it shows a Phone Verification implementation.

It uses four channels for delivery, SMS, Voice, Soft Tokens, and Push Notifications. You should have the Authy App installed to try Soft Token and Push Notification support.

Two-Factor Authentication Demo

  • URL path "/protected" is protected with both user session and Twilio Two-Factor Authentication
  • One Time Passwords (SMS and Voice)
  • SoftTokens
  • Push Notifications (via polling)

Phone Verification

  • Phone Verification
  • SMS or Voice Call

Run it

Pre-requisites

Ensure your MySQL credentials and host are set up in the env file, which you copy from .env.example.

  1. Clone this repo
    git clone [email protected]:TwilioDevEd/account-security-quickstart-php.git
  2. composer install
  3. Register for a Twilio Account.
  4. Setup an Account Security app via the Twilio Console.
  5. cp .env.example .env
  6. Grab an Application API key from the Dashboard and paste it in .env as API_KEY
  7. Run php artisan migrate
  8. Run php artisan serve --port 8081
  9. Go to localhost:8081 or see below.

To try Authy Two-Factor Authentication

  1. Open the following url in your browser: http://localhost:8081/login

At that point you can test a channel. To test another, simply logout after your success and login again.

To try Verify Phone Verification

  1. Open the following url in your browser: http://localhost:8081/verify

At that point you can test SMS/Phone Calls. To test another, simply logout after your success. You'll be brought back to the index page to try again with the other.

Test

  1. phpunit

License

  • MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • PHP 71.5%
  • HTML 20.1%
  • JavaScript 5.9%
  • Shell 1.3%
  • Other 1.2%