Multi-factor authentication for Yii2 projects
This package provides:
- TOTP - Time-based One-time Password Algorithm used for two factor authentication
- checking for user allowed IPs
- generation and checking recovery codes (PLANNED)
Can be plugged into any exising Yii2 project. See how it is used in hiqdev/hiam.
The preferred way to install this yii2-extension is through composer.
php composer.phar require "hiqdev/yii2-mfa"
to the require section of your composer.json.
This extension provides pluggable configuration to be used with composer-config-plugin.
Also you can use it usual way by copy-pasting config. See src/config/web.php for configuration example.
Available configuration parameters:
For more details please see src/config/params.php.
This plugin provides behavior and configuration attaches it
to user component on
And then the behavior validates IPs and TOTP on every login.
To use this plugin you need to provide:
allowed_ipsreadable and writable property in your user component for allowed IPs functionality
totp_secretreadable and writable property in your user component for TOTP functionality
IPs and TOTP functions are independent and you can provide just one of properties to have only corresponding functionality.
Copyright © 2016-2018, HiQDev (http://hiqdev.com/)