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.
- 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
- SMS or Voice Call
Ensure your MySQL credentials and host are set up in the env file, which you copy from .env.example.
- Clone this repo
git clone [email protected]:TwilioDevEd/account-security-quickstart-php.git
composer install- Register for a Twilio Account.
- Setup an Account Security app via the Twilio Console.
cp .env.example .env- Grab an Application API key from the Dashboard and paste it in
.envasAPI_KEY - Run
php artisan migrate - Run
php artisan serve --port 8081 - Go to localhost:8081 or see below.
- 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.
- 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.
phpunit
- MIT