Download the PHP package ipunkt/laravel-two-factor-authentication without Composer

On this page you can find all versions of the php package ipunkt/laravel-two-factor-authentication. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-two-factor-authentication

Two Factor Authentication

Total Downloads Latest Stable Version Latest Unstable Version License

Introduction

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

Installation

Just install the package by adding to composer requirements

composer require ipunkt/laravel-two-factor-authentication

and add the Service Provider in your config/app.php

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

After adding the provider the database migration should run

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

This trait has to be added to the authorization based user model class.

Authentication Controller

The Ipunkt\Laravel\TwoFactorAuthentication\AuthenticatesWith2FA trait overrides the authenticated method within the LoginController. So please update your LoginController

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.

Customizing Package Content

Config

You can change config settings by publishing config file

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

and edit /config/2fa.php to suit your needs.

Views

You can change delivered views by publishing view files

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

and edit views in /resources/views/vendor/2fa.

Migrations

You can change the packaged migrations by publishing migrations

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

and edit migrations in /database/migrations.

License

Two Factor Authentication is open-sourced software licensed under the MIT license


All versions of laravel-two-factor-authentication with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.4
pragmarx/google2fa Version ~1.0
paragonie/constant_time_encoding Version ~2.0
bacon/bacon-qr-code Version ~1.0
ipunkt/laravel-package-manager Version ^0.2.0
illuminate/database Version ^5.3
illuminate/http Version ^5.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ipunkt/laravel-two-factor-authentication contains the following files

Loading the files please wait ....