umanit / 2fa-sms
Extends scheb/2fa-bundle with two-factor authentication via SMS
Installs: 20
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^8.2
- scheb/2fa-bundle: ^7.2
- symfony/framework-bundle: ^6.4 || ^7.2
- symfony/notifier: ^6.4 || ^7.2
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-symfony: ^2.0
- phpunit/phpunit: ^11.5
- squizlabs/php_codesniffer: ^3.12
- symfony/phpunit-bridge: ^7.2
README
This package extends scheb/2fa-bundle with two-factor authentication using SMS.
Installation
composer require umanit/2fa-sms
// config/bundles.php return [ Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], Scheb\TwoFactorBundle\SchebTwoFactorBundle::class => ['all' => true], Umanit\TwoFactorSms\UmanitTwoFactorSmsBundle::class => ['all' => true], ];
Configuration
In order to work, the bundle uses Symfony's Notifier component and the
SMS channel managed by the texter
service.
You'll need to configure your application with
an SMS channel before you can use this bundle.
These are the default configuration values.
# Default configuration for extension with alias: "umanit_two_factor_sms"
umanit_two_factor_sms:
enabled: true
# A custom form renderer service that must implement "Scheb\TwoFactorBundle\Security\TwoFactor\Provider\TwoFactorFormRendererInterface".
form_renderer: null
# Twig template to pass to "Scheb\TwoFactorBundle\Security\TwoFactor\Provider\DefaultTwoFactorFormRenderer".
template: '@SchebTwoFactor/Authentication/form.html.twig'
# Custom auth code generator service that must implement "Umanit\TwoFactorSms\Security\AuthCode\AuthCodeGeneratorInterface".
code_generator: null
# The number of digits the generated auth code will have.
digits: 6
# Custom auth code sender service that must implement "Umanit\TwoFactorSms\Security\AuthCode\AuthCodeSenderInterface".
code_sender: null
# A valid \DateInterval used to expire the auth code.
expires_after: PT15M
# Custom auth code texter service that must implement "Umanit\TwoFactorSms\Texter\AuthCodeTexterInterface".
code_texter: null
# Custom texter message generator service that must implement "Umanit\TwoFactorSms\Texter\SmsMessageGeneratorInterface".
message_generator: null
# Message send by the texter. The template string [[auth_code]] will be replaced with the actual auth code.
message: '[[auth_code]]'
License
This software is available under the MIT license.