You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TODO: Description of integration (abstract two-factor-auth controller, templates) and settings
17
+
## Configuration
18
+
The following part describes the integration of the Two-Factor-Authentication package into an existing Flow Application.
19
+
The package can be integrated into a working application without applying any data migrations to the existing user base.
20
+
Existing users will simply be treated as if Two-Factor-Authentication is disabled for them.
21
+
22
+
### Provider
23
+
Instead of using the default UsernamePasswordProvider, adapt your settings to use the following provider instead: `Yeebase\TwoFactorAuthentication\Security\Authentication\Provider\TwoFactorAuthenticationProvider`
24
+
25
+
### Controllers and Templates
26
+
This package brings two abstract controllers that contain all the methods necessary for login with and management of Two-Factor-Authentication.
27
+
28
+
Instead of inheriting from the basic `AbstractAuthenticationController`, you should now inherit from `AbstractTwoFactorAuthenticationController` in your LoginController.
29
+
The template of your login action should be adapted as described in the `TwoFactorUsernamePasswordToken` class.
30
+
Additionally, you need to add a template for the `insertSecretAction` where the user can insert a secret.
31
+
32
+
For the management of Two-Factor-Authentication you can inherit from the `AbstractAuthenticationManagementController`.
33
+
Using this controller, it is necessary to provide exactly one template for the `configureAction`.
34
+
When 2FA is disabled, it passes an `activationQrCode`-parameter to the template that holds the QR-Code which can be scanned by a GoogleAuthenticator.
35
+
When 2FA is enabled, it does not pass any parameters to the template. From this point on, either the `enableAction` or the `disableAction` should be called
36
+
with a `secret`-parameter given by the user to enable/disable 2FA.
37
+
38
+
### Settings
39
+
For the application to run, you should at least provide an `applicationName` which will be displayed in the Authenticator-App of the user.
40
+
Furthermore, the `authenticationEntryPoint` should be specified. It configures where the user is redirected to, when he or she has to insert the secret for 2FA.
41
+
This should usually be the LoginController of your package (if you inherited from `AbstractTwoFactorAuthenticationController` as described above).
0 commit comments