Skip to content

A laravel application with 2fa added to the registration and login flows

Notifications You must be signed in to change notification settings

anlofw/laravel-2fa-starter

 
 

Repository files navigation

Laravel Two Factor Authentication starter

This is a fresh laravel application with the default authentication modified to enforce two factor authentication.

The package pragmarx/google2fa-laravel was used to generate and authenticate the secret keys, while bacon/bacon-qr-code was used to generate the inline styles.

Getting started

You can simply clone, change the environment variables and run migrations to begin.

Usage

During registration, users will be forced to set up their Google Authenticator by scanning a barcode or typing the secret key.

Once logged in, if a user wants to change the secret, they can navigate to myapp.test/re-authenticate.

As the admin if you want to change the user's secret yourself, run this command from the console.

php artisan 2fa:reauthenticate

It will prompt for the user's email and then ask for confirmation before generating and displaying the new keys.

You can pass the email directly using the --email option, and skip the confirmation stop by adding the --force option.

php artisan 2fa:reauthenticate --email=user@example.com --force

Self-Promotion

If you like this project, please star the repository on GitHub. You might also consider visiting my blog and following me on Twitter and Github.

About

A laravel application with 2fa added to the registration and login flows

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 79.2%
  • HTML 20.2%
  • Vue 0.6%