mirror of
https://github.com/RobThree/TwoFactorAuth.git
synced 2026-08-17 10:00:57 +00:00
* Moving more stuff around
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
#  TwoFactorAuth class for PHP
|
||||
#  TwoFactorAuth class for PHP
|
||||
|
||||
PHP class for [two-factor (or multi-factor) authentication](http://en.wikipedia.org/wiki/Multi-factor_authentication) using [TOTP](http://en.wikipedia.org/wiki/Time-based_One-time_Password_Algorithm) and [QR-codes](http://en.wikipedia.org/wiki/QR_code). Inspired by, based on but most importantly an *improvement* on '[PHPGangsta/GoogleAuthenticator](https://github.com/PHPGangsta/GoogleAuthenticator)'.
|
||||
|
||||
<p align="center">
|
||||
<img src="https://raw.githubusercontent.com/RobThree/TwoFactorAuth/master/multifactorauthforeveryone.png">
|
||||
<img src="https://raw.githubusercontent.com/RobThree/TwoFactorAuth/master/img/multifactorauthforeveryone.png">
|
||||
</p>
|
||||
|
||||
## Requirements
|
||||
@@ -30,7 +30,7 @@ Here are some code snippets that should help you get started...
|
||||
|
||||
````php
|
||||
// Create a TwoFactorAuth instance
|
||||
$tfa = new RobThree\TwoFactorAuth\TwoFactorAuth('My Company');
|
||||
$tfa = new RobThree\Auth\TwoFactorAuth('My Company');
|
||||
````
|
||||
|
||||
The TwoFactorAuth class constructor accepts 6 parameters (all optional):
|
||||
@@ -155,8 +155,8 @@ That's it. We're done! We've implemented our own provider (with help of PHP QR C
|
||||
|
||||
````php
|
||||
<?php
|
||||
$mp = new RobThree\TwoFactorAuth\TwoFactorAuth\Providers\Qr\MyProvider();
|
||||
$tfa = new RobThree\TwoFactorAuth\TwoFactorAuth\TwoFactorAuth('My Company', 6, 30, 'sha1', $mp);
|
||||
$mp = new RobThree\Auth\Providers\Qr\MyProvider();
|
||||
$tfa = new RobThree\Auth\TwoFactorAuth('My Company', 6, 30, 'sha1', $mp);
|
||||
$secret = $tfa->createSecret();
|
||||
?>
|
||||
<p><img src="<?php $tfa->getQRCodeImageAsDataUri('Bob Ross', $secret) ?>"></p>
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
<IncludeDebugInformation>false</IncludeDebugInformation>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="demo.php" />
|
||||
<Compile Include="loader.php" />
|
||||
<Compile Include="demo\demo.php" />
|
||||
<Compile Include="demo\loader.php" />
|
||||
<Compile Include="lib\Providers\Qr\BaseHTTPQRCodeProvider.php" />
|
||||
<Compile Include="lib\Providers\Qr\GoogleQRCodeProvider.php" />
|
||||
<Compile Include="lib\Providers\Qr\IQRCodeProvider.php" />
|
||||
@@ -45,11 +45,13 @@
|
||||
<Folder Include="lib\Providers\" />
|
||||
<Folder Include="lib\Providers\Qr\" />
|
||||
<Folder Include="lib\Providers\Rng\" />
|
||||
<Folder Include="demo\" />
|
||||
<Folder Include="img\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="composer.json" />
|
||||
<Content Include="LICENSE" />
|
||||
<Content Include="logo.png" />
|
||||
<Content Include="multifactorauthforeveryone.png" />
|
||||
<Content Include="img\logo.png" />
|
||||
<Content Include="img\multifactorauthforeveryone.png" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -10,7 +10,7 @@
|
||||
require_once 'loader.php';
|
||||
Loader::register('RobThree','RobThree');
|
||||
|
||||
use \RobThree\TwoFactorAuth\TwoFactorAuth;
|
||||
use \RobThree\Auth\TwoFactorAuth;
|
||||
|
||||
$tfa = new TwoFactorAuth('MyApp');
|
||||
|
||||
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Reference in New Issue
Block a user