clef / instant2fa
A PHP client for Instant2FA.
1.0.1
2016-11-30 18:37 UTC
Requires
- php: >=5.4
- cloudcreativity/json-api: ^0.6.0
- guzzlehttp/guzzle: ~6.0
- tobscure/json-api: ^0.3.0
Requires (Dev)
- phpunit/phpunit: ~4.0
- satooshi/php-coveralls: ~0.6.1
- squizlabs/php_codesniffer: ~2.0
This package is not auto-updated.
Last update: 2024-11-09 20:57:01 UTC
README
A PHP client for Instant2FA.
Installation
Install it with composer:
composer require clef/instant2fa
Requires PHP 5.4 or newer.
Usage
See our integration guide for a full walkthrough of the integration. The integration will take you about an hour.
Here's a flavor of the methods you'll be using:
$instant2fa = new \Instant2FA\Instant2FA([ 'access_key' => ACCESS_KEY, 'access_secret' => ACCESS_SECRET ]); $distinct_id = "A_UNIQUE_ID_FOR_A_GIVEN_USER"; // To show hosted 2FA settings: $hosted_page_url = $instant2fa->create_settings($distinct_id); // To show a hosted verification page: try { $hosted_page_url = $instant2fa->create_verification($distinct_id); // Redirect to 2FA verification page } catch (\Instant2FA\Error\MFANotEnabled $e) { // Log the user in as normal } // To see whether a user successfully completed 2FA verification: $succeeded = $instant2fa->confirm_verification($distinct_id, $request->input('instant2faToken'));