Download the PHP package yeebase/twofactorauthentication without Composer
On this page you can find all versions of the php package yeebase/twofactorauthentication. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yeebase/twofactorauthentication
More information about yeebase/twofactorauthentication
Files in yeebase/twofactorauthentication
Package twofactorauthentication
Short Description Two-Factor-Authentication (2FA) for Neos Flow
License MIT
Informations about the package twofactorauthentication
Yeebase.TwoFactorAuthentication
The Yeebase.TwoFactorAuthentication Flow package contains extensions to the Flow authentication mechanism that let you implement Two-Factor-Authentication (2FA) easily.
It provides a new Authentication Provider that can be used in addition to existing providers in order to enable 2FA via One-time Passwords (OTP).
Installation
This package can be installed via composer:
composer require yeebase/twofactorauthentication
This package requires a new database table yeebase_twofactorauthentication_secret
that can be added via:
./flow doctrine:migrate
Configuration
The following part describes the integration of the Two-Factor-Authentication package into an existing Flow Application. After installation Two-Factor-Authentication is considered to be disabled for all accounts in the system.
Authentication Provider
This package provides a TwoFactorAuthenticationProvider
that has to be configured in addition to already existing providers.
Furthermore the authenticationStrategy has to be set to allTokens
in order to make sure that both providers are taken into account.
Example:
Settings.yaml
:
Application name and Routes
If a TwoFactorAuthenticationProvider
Settings.yaml
:
Login/TwoFacor.html
Instead of using the default UsernamePasswordProvider, adapt your settings to use the following provider instead: Yeebase\TwoFactorAuthentication\Security\Authentication\Provider\TwoFactorAuthenticationProvider
Force Two-Factor Authentication
By default 2FA can be enabled per account and it is not required if it is not enabled for the account that is authenticated.
In order to require users to log in with Two-Factor Authentication the Yeebase.TwoFactorAuthentication.requireTwoFactorAuthentication
flag can be set.
With that in place the One-time Password has to be specified whenever an account is authenticated.
To avoid this to leading to an exception when 2FA is not yet enabled for the given account, a setup can be configured that allows the user to initialize the 2FA.
Settings.yaml
:
And the corresponding Setup Controller (example):
TwoFactorAuthenticationSetupController.php
And the corresponding Template (example):
TwoFactorAuthenticationSetup/Index.html
:
In order to allow the user to setup 2FA initially, the corresponding actions have to be allowed to be called even if no 2FA is enabled for the account yet. This can be achieved with
the provided ExcludeTwoFactorAuthenticationSetup
Request Pattern that
disables the 2FA authentication provider for the setup
route configured above:
Settings.yaml
:
Note: The ExcludeTwoFactorAuthenticationSetup
will disable 2FA for all actions of the configured controller, so the controller should not do any critical tasks without
further checks.
License
This package is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
This package depends on the google2fa package for generating and validating secrets/OTP and the BaconQrCode for QR Code rendering