internetgalerie/ig-mfa-frontend

MFA for Frontend

Installs: 137

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 1

Type:typo3-cms-extension

v0.9.1 2024-05-29 16:39 UTC

This package is auto-updated.

Last update: 2024-12-11 11:14:22 UTC


README

The extension enables Multi Factor Authentication (MFA) for frontend user.

1. What does it do?

The extension extends the login mechanism with MFA. MFA is done in a separate step with its own template. There is also a controller with which frontend users can set up MFA. All installed MFA providers are supported by default; this can be restricted using TypoScript.

2. Usage

1) Installation

The recommended way to install the extension is by using Composer. In your Composer based TYPO3 project root, just do composer require internetgalerie/ig-mfa-frontend.

2) TypoScript

  • base.css includes styles from TYPO3 backend, including Bootstrap, making it bulky and ugly for the frontend. TODO: Clean up and optimize, possibly add and call provider frontend setup if available (to get better html)

3) Providers

tested providers:

4) Extension Setup

3. Core Changes

Changes to show and delete MFA Providers for frontend users in Backend (not required for frontend functionality)

TCA

MfaInfoElement.php

File: vendor/typo3/cms-backend/Classes/Form/Element/MfaInfoElement.php at line 69 add

        $targetUser->checkPid = false;

looks like:

        // Initialize a user based on the current table name
        $targetUser = $tableName === 'be_users'
            ? GeneralUtility::makeInstance(BackendUserAuthentication::class)
            : GeneralUtility::makeInstance(FrontendUserAuthentication::class);

        $userId = (int)($this->data['databaseRow'][$targetUser->userid_column] ?? 0);
        $targetUser->enablecolumns = ['deleted' => true];
        // CHANGES BEGIN
        $targetUser->checkPid = false;
        // CHANGES END
        $targetUser->setBeUserByUid($userId);

MfaAjaxController.php

File vendor/typo3/cms-backend/Classes/Controller/MfaAjaxController.php at line 152

        $user->checkPid = false;

looks like:

        $user->enablecolumns = ['deleted' => true];
        // CHANGES BEGIN
        $user->checkPid = false;
        // CHANGES END
        $user->setBeUserByUid($userId);

Middleware

FrontendUserAuthenticator.php

Currently, we are overriding the FrontendUserAuthenticator middleware in this extension. We have added the handling of the MfaRequiredException exception and subsequently dispatching an event. So no changes are required.

4. Screenshots

MFA Setup

Overview of Available MFA Providers

Setup for MFA overview for logged in users

The Setup plugin starts with an overview of the available MFA providers for logged-in users. Users can select and activate their preferred methods.

Example: Setting up Time-based One-Time Password

This image demonstrates the setup process for a Time-based One-Time Password MFA method. Users can follow these steps to configure their MFA device.

Setup for MFA provider for logged in users

Login Process

Step 1: felogin Login Form

Users start by filling out the login form provided by felogin extension.

felogin Login Form

Step 2: MFA Login Form

After successful authentication with the username and password, users are prompted with the MFA (Multi-Factor Authentication) login form.

MFA Login Form

default template is EXT:ig_mfa_frontend/Resources/Private/Extensions/felogin/Templates/Login/Mfa.html