PHPackages                             spryker-ufirst/second-factor-auth - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. spryker-ufirst/second-factor-auth

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

spryker-ufirst/second-factor-auth
=================================

Second Factor Authentication for Spryker ZED

v2.1.0(3y ago)343.7k↓50%6[1 issues](https://github.com/ufirstgroup/spryker-second-factor-auth/issues)PHPPHP &gt;=7.3

Since Dec 2Pushed 2y ago3 watchersCompare

[ Source](https://github.com/ufirstgroup/spryker-second-factor-auth)[ Packagist](https://packagist.org/packages/spryker-ufirst/second-factor-auth)[ RSS](/packages/spryker-ufirst-second-factor-auth/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (14)Versions (17)Used By (0)

Second Factor Authentication for the Spryker Administration Interface
=====================================================================

[](#second-factor-authentication-for-the-spryker-administration-interface)

Installation
------------

[](#installation)

```
composer require spryker-ufirst/second-factor-auth

```

Once the module is installed, add the `SecondFactorAuthorizationEventDispatcherPlugin` to the `EventDispatcherDependencyProvider::getEventDispatcherPlugins` at the end of the array:

```
class EventDispatcherDependencyProvider extends SprykerEventDispatcherDependencyProvider
{
    /**
     * @return \Spryker\Shared\EventDispatcherExtension\Dependency\Plugin\EventDispatcherPluginInterface[]
     */
    protected function getEventDispatcherPlugins(): array
    {
        return [
            # ...other plugins
            new SecondFactorAuthorizationEventDispatcherPlugin(),
        ];
    }
}
```

And add the `SprykerUFirst` namespace to the `config_default.php`

```
$config[KernelConstants::CORE_NAMESPACES] = [
    ...
    'SprykerUFirst',
];
```

Enforcing 2FA
-------------

[](#enforcing-2fa)

You can enforce second factor authentication for all admin users per environment. Add the following line to your `config_default.php`:

```
use SprykerUFirst\Shared\SecondFactorAuth\SecondFactorAuthConstants;
...
$config[SecondFactorAuthConstants::SECOND_FACTOR_AUTH_REQUIRED] = true;
```

Add 2FA Status to the User Table
--------------------------------

[](#add-2fa-status-to-the-user-table)

In order to see the 2FA status (enabled/disabled) on each user in the administration GUI, add the two table expander plugins to the `UserDependencyProvider` in your project space:

```
