Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.
/ fuelphp-TOTP Public archive

A package for fuelphp. It's a two authentification factor using TOTP.

Notifications You must be signed in to change notification settings

Dryusdan/fuelphp-TOTP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Fuelphp Two authentification with TOTP

A fuelphp package for create two authentification with TOTP system.


This package can create a QRCode as Google, Microsoft two authentification factor using Google authenticator on IOS and Android, or Microsoft Authenticator for Windows Phone.

About

Warning

This is an alpha test, it's stable but comments are missing and some small functions. Sorry

Installation

You can simply download the package and extract it into fuel/packages/totp folder or you can go under your fuel/packages folder and run this command:

  $ git clone https://github.com/Dryusdan/fuelphp-TOTP

Configuration

You need to create an member area. When it's ok, you need create database for this package. Run command

php oil refine migrate --packages=totp

for create table.

Common Methods

For create member, you need: id of member, email of member.

Create user key and QRCode

<?php
    $addUsers = Totp::addUser('1', 'some@email.ex');
    $QRCode = Totp::generateQrCode('some@email.ex', $addUsers);
?>
<img src="<?php echo $QRCode; ?>" />

Check token

<?php
    $query = Totp::checkToken('some@email.exr', '303011');
    if($query == '1'){
        echo 'access';
    }
    else{
        echo 'wrong key';
    }
?>

This is an alpha test andlater comes later. :)

About

A package for fuelphp. It's a two authentification factor using TOTP.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages