Download the PHP package maurohmartinez/two-factor-auth-laravel without Composer

On this page you can find all versions of the php package maurohmartinez/two-factor-auth-laravel. 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 two-factor-auth-laravel

2FA Auth for Laravel

Latest Version on Packagist Total Downloads

A simple 2FA that uses Google Authenticator.

About The Project

This project uses the following three packages:

You can obviously install those three packages and do it yourself, but this is a quick and easy implementation.

In short, this package requests users to validate their credentials with Google Authenticator right after they logged in.

screenshot-1

screenshot-2

Also, if you have a "remember" input in your login form, we pick up on that and add a cookie after successful validation. So the next time the user visits the site, we don't ask again for 2FA validation. Once the user logs out, we removed the cookie.

Installation

  1. Use composer to require this project

  2. Run migrations

  3. Publish config, views, and public files and customize them as (and if) you need

  4. [optional] Adjust middleware group name

    This package automatically applies a middleware to route "admin", but you can adjust that by updating the config file:

    You can also manually add the middleware MHMartinez\TwoFactorAuth\app\Http\Middleware\TwoFactorAuthMiddleware where you need it.

  5. [optional] If you only want to ask certain users to validate 2FA, your User model should implement interface MHMartinez\TwoFactorAuth\app\Interfaces\TwoFactorAuthInterface. That will require you to add a new method shouldValidateWithTwoFactorAuth which should return a boolean indicating whether the middleware should skip that given user.

    Sample of your User Model Class:

    Sample of method shouldValidateWithTwoFactorAuth():

  6. [optional] Disable this package in local environments by adding TWO_FACTOR_AUTH_ENABLED=false in your .env

  7. [optional] Set in days when the one-time-password expires in the config file. FYI, 0 means it never expires '2fa_expires' => 0,

Contact

Project Link: https://github.com/maurohmartinez/two-factor-auth-laravel


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

PHP Build Version
Package Version
Requires php Version ^8.1
pragmarx/google2fa-qrcode Version ^3.0
pragmarx/google2fa-laravel Version ^2.0
laravel/framework Version ^8.0.0|^9.0.0|^10.0.0|^11.0.0|^12.0.0
bacon/bacon-qr-code Version ^2.0.0
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 maurohmartinez/two-factor-auth-laravel contains the following files

Loading the files please wait ....