2017 © Pedro Peláez
 

yii2-extension yii2-authy

Yii2 authy 2FA

image

geoffry304/yii2-authy

Yii2 authy 2FA

  • Thursday, June 7, 2018
  • by Geoffry304
  • Repository
  • 1 Watchers
  • 0 Stars
  • 29 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 13 Versions
  • 7 % Grown

The README.md

yii2-authy

Latest Version Software License Total Downloads, (*1)

Extension for using 2FA from Authy with Yii2 and amnah/yii2-user

Installation

The preferred way to install yii2-authy is through Composer. Either add the following to the require section of your composer.json file:, (*2)

"geoffry304/yii2-authy": "*", (*3)

Or run:, (*4)

$ php composer.phar require geoffry304/yii2-authy "*", (*5)

You can manually install yii2-authy by downloading the source in ZIP-format., (*6)

Run the migration file php yii migrate --migrationPath=@vendor/geoffry304/yii2-authy/migrations, (*7)

Update the config file, (*8)

// app/config/web.php
return [
    'modules' => [
        'authy' => [
            'class' => 'geoffry304\authy\Module',
            'api_key' => 'here your api key from authy',
            'send_mail_from => 'demo@example.com'
        ],
        'user' => [
            'class' => 'amnah\yii2\user\Module',
            'modelClasses' => [
                'LoginForm' => 'geoffry304\authy\forms\LoginForm'
            ]
        ],
    ],
];

Using Authy

You need to add this piece of code before you try performLogin, (*9)

$module2FA = Yii::$app->getModule('authy');
if ($module2FA) {
    Yii::$app->session->set('credentials', ['login' => $model->email, 'pwd' => $model->password, 'remember' => $rememberMe]);
    $returnUrl = $module2FA->validateLogin($model->getUser());
    return $returnUrl;  
}
 ``` 
#### Options ####

**Module** Has the following options to modify it's behaviour:

- **api_key**: The key you get from authy website to make connection with it.
- **api_url**: If you want to use an other url standard to https://api.authy.com.
- **default_expirytime**: The expire time the user will need to insert a new token standard to 30 days.
- **send_mail**: Send mail when new device is added, standard to true.
- **send_mail_from**: Send mail from required when send_mail is on.
- **logo**: Path tho logo used in confirmation and registration form and also in sending mail.

If you need extra security, you can check on every action and controller if the current session still exist in db.

Update the config file
```php
// app/config/web.php
return [
    'bootstrap' => ['GlobalCheck'],
    'components' => [
        'GlobalCheck'=> [
            'class'=>'geoffry304\authy\components\GlobalCheck'
         ],
     ],
];

The Versions

12/01 2018

1.2

1.2.0.0 https://github.com/geoffry304/yii2-authy

Yii2 authy 2FA

  Sources   Download

BSD-3-Clause

The Requires

 

authentication extension yii2 2fa 2 factor authy

11/01 2018

1.1.1

1.1.1.0 https://github.com/geoffry304/yii2-authy

Yii2 authy 2FA

  Sources   Download

BSD-3-Clause

The Requires

 

authentication extension yii2 2fa 2 factor authy

11/01 2018

1.1

1.1.0.0 https://github.com/geoffry304/yii2-authy

Yii2 authy 2FA

  Sources   Download

BSD-3-Clause

The Requires

 

authentication extension yii2 2fa 2 factor authy

03/01 2018

1.0.1

1.0.1.0 https://github.com/geoffry304/yii2-authy

Yii2 authy 2FA

  Sources   Download

BSD-3-Clause

The Requires

 

authentication extension yii2 2fa 2 factor authy

03/01 2018

1.0

1.0.0.0 https://github.com/geoffry304/yii2-authy

Yii2 authy 2FA

  Sources   Download

BSD-3-Clause

The Requires

 

authentication extension yii2 2fa 2 factor authy