2017 © Pedro Peláez
 

library laravel-two-factor-authentication

Two factor authentication (2FA) with TOTP tokens. (RFC 6238)

image

ipunkt/laravel-two-factor-authentication

Two factor authentication (2FA) with TOTP tokens. (RFC 6238)

  • Wednesday, November 1, 2017
  • by rokde
  • Repository
  • 2 Watchers
  • 1 Stars
  • 40 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 5 % Grown

The README.md

Two Factor Authentication

Total Downloads Latest Stable Version Latest Unstable Version License, (*1)

Introduction

This package adds 2FA (Two Factor Authentication) to your laravel application., (*2)

Installation

Just install the package by adding to composer requirements, (*3)

composer require ipunkt/laravel-two-factor-authentication

and add the Service Provider in your config/app.php, (*4)

\Ipunkt\Laravel\TwoFactorAuthentication\TwoFactorAuthenticationServiceProvider::class,

After adding the provider the database migration should run, (*5)

php artisan migrate

Setup

User Model Trait

The package adds a google2fa_secret column to your users table. This can be null, but should hold the secret key, being generated with the help of a trait: Ipunkt\Laravel\TwoFactorAuthentication\TwoFactorSupport, (*6)

This trait has to be added to the authorization based user model class., (*7)

Authentication Controller

The Ipunkt\Laravel\TwoFactorAuthentication\AuthenticatesWith2FA trait overrides the authenticated method within the LoginController. So please update your LoginController, (*8)

use App\Http\Controllers\Controller;
use Ipunkt\Laravel\TwoFactorAuthentication\AuthenticatesWith2FA;
use Illuminate\Foundation\Auth\AuthenticatesUsers;

class LoginController extends Controller
{
    use AuthenticatesUsers,
            AuthenticatesWith2FA {
            AuthenticatesWith2FA::authenticated insteadof AuthenticatesUsers;
        }
    //...
}

So we can interact with the user after authenticating with user credentials and display a TOTP field to get the Authenticator App displayed One-Time-Token., (*9)

Customizing Package Content

Config

You can change config settings by publishing config file, (*10)

$> php artisan vendor:publish --provider="Ipunkt\Laravel\TwoFactorAuthentication\ServiceProvider" --tag=config

and edit /config/2fa.php to suit your needs., (*11)

Views

You can change delivered views by publishing view files, (*12)

$> php artisan vendor:publish --provider="Ipunkt\Laravel\TwoFactorAuthentication\ServiceProvider" --tag=view

and edit views in /resources/views/vendor/2fa., (*13)

Migrations

You can change the packaged migrations by publishing migrations, (*14)

$> php artisan vendor:publish --provider="Ipunkt\Laravel\TwoFactorAuthentication\ServiceProvider" --tag=migrations

and edit migrations in /database/migrations., (*15)

License

Two Factor Authentication is open-sourced software licensed under the MIT license, (*16)

The Versions

01/11 2017

dev-master

9999999-dev

Two factor authentication (2FA) with TOTP tokens. (RFC 6238)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Kummer

laravel authentication 2fa two-factor rfc-6238

01/11 2017

1.0.0

1.0.0.0

Two factor authentication (2FA) with TOTP tokens. (RFC 6238)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Kummer

laravel authentication 2fa two-factor rfc-6238

06/12 2016

0.1.1

0.1.1.0

Two factor authentication (2FA) with TOTP tokens. (RFC 6238)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Kummer

laravel authentication 2fa two-factor rfc-6238

06/12 2016

0.1.0

0.1.0.0

Two factor authentication (2FA) with TOTP tokens. (RFC 6238)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Kummer

laravel authentication 2fa two-factor rfc-6238