Download the PHP package listra/twofa without Composer

On this page you can find all versions of the php package listra/twofa. 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 twofa

Package to work with two-factor authentication along with laravel passport

In your Users model you should add

       use TwoFactorAuthentication

run the migrations

        php artisan migrate

they will add three fields to the users table,also add them to fillable

        'google2fa_secret',
        'google2fa_recovery_codes',
        'google2fa_enable',

You now have these routers available, routers are secured by default Route::middleware('auth:api')

        POST      two-factor-authentication 
        DELETE    two-factor-authentication/{user} 
        GET|HEAD  two-factor-qr-code 
        GET|HEAD  two-factor-recovery-codes

How it works

We always get a unique ik-svu until it is enabled. Enabled using a code obtained from the Google authorization of the application

        GET|HEAD  two-factor-qr-code 

Enables and disables 2FA, but backup codes can be used to disable it.

        POST      two-factor-authentication
        DELETE    two-factor-authentication/{user} 

List of backup codes, they have statuses for display on the frontend.

      GET|HEAD  two-factor-recovery-codes

        {
        "code": "DiAHiXyqsV-PZ2grE1huc",
        "active": false
        },
        {
        "code": "jqzDmcYYmA-xCQiU75dyJ",
        "active": true
        },

Now, when authorizing through a passport, you will have to add a code field to the request body. This is the code from the Google application or the backup code.

This should work. When an access request comes in, we check to see if 2AF is enabled. Return if "status2FA" is enabled: true.

further in the request body you have to send

Example for auth url oauth/token

    "grant_type" : "password",
    "client_id" : "2",
    "client_secret" : "6wAGwcP98VT90S5biQZjREIq4udQ7EhmwNrUzBkV",
    "username": "[email protected]",
    "password": "password",
    "scope": "",
    "code":"DiAHiXyqsV-PZ2grE1huc"

Then you can get a token for further work.


All versions of twofa with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
bacon/bacon-qr-code Version ^2.0
pragmarx/google2fa-laravel Version ^2.2.0
laravel/passport Version ^12.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 listra/twofa contains the following files

Loading the files please wait ....