Two Factor Login for Statamic 3
Statamic 2FA is a middleware addon for Statamic 3 that adds 2FA (2 factor) auth to the control panel of Statamic 3 using time based codes.
Statamic 2FA is commercial software. You do not need a licence for development but when you are ready to deploy the site to production please purchase a licence per site on the Statamic Marketplace.
Install the addon using composer
composer require kind-work/two-fa
two_fa field to your user blueprint. Edit your user profile in the control panel (CP) to set up 2FA protection for your account.
title: User sections: main: display: Main fields: - handle: name field: type: text display: Name - handle: email field: type: text input: email display: 'Email Address' - handle: roles field: type: user_roles width: 50 - handle: groups field: type: user_groups width: 50 - handle: avatar field: type: assets max_files: 1 - handle: two_fa field: type: two_fa localizable: false display: 'Two FA'
Force 2FA Login
To force 2FA for all users set an environment variable
To force 2FA for specific roles, publish the config file and edit as appropriate.
php artisan vendor:publish --tag="two-fa-config"