2017 © Pedro Peláez
 

yii2-extension yii2-http-auth

Yii2 Http Authentication extension

image

lajax/yii2-http-auth

Yii2 Http Authentication extension

  • Friday, March 18, 2016
  • by lajax
  • Repository
  • 2 Watchers
  • 3 Stars
  • 1,723 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 9 % Grown

The README.md

Yii2 HTTP authentication extension

Latest Version on Packagist ![Software License][ico-license] Total Downloads, (*1)

This extension can be used to protect your Yii2 application with HTTP authentication against unauthorized access. For example you can use it to prevent users seeing your development environment., (*2)

Installation

Via Composer, (*3)

composer require lajax/yii2-http-auth

Usage

You need to bootstrap the component on the start of the application., (*4)

On execution the component will check the IP address of the user. If the IP address is not in the allowedIps list, a HTTP authentication will be performed., (*5)

With the users option you can specify username and password pairs for accessing the application. The value can be either an actual password, or an MD5 hash of the password., (*6)

Config

'bootstrap' => ['httpAuth'],
'components' =>  [
    // ...
    'httpAuth' => [
        'class' => 'lajax\httpauth\Component',
        'allowedIps' => ['127.0.0.1', '127.0.0.2'],
        'users' => [
            // Actual password:
            'mrsmith' => '123456',
            // MD5 hash of the password:
            'mrssmith' => 'e10adc3949ba59abbe56e057f20f883e',
        ],
        'errorAction' => 'site/error',
    ],
    // ...
]

Testing

composer test

Coding style

The project uses the PSR-2 coding standard. Related commands:, (*7)

  • composer cs-fix: Fix coding style issues.
  • composer cs-check: Check for coding style issues.

Changelog

Please see CHANGELOG for more information on what has changed recently., (*8)

License

The 3-Clause BSD License. Please see License File for more information., (*9)

The Versions

18/03 2016

dev-master

9999999-dev

Yii2 Http Authentication extension

  Sources   Download

BSD-3-Clause

The Requires

 

by Lajos Molnar

authentication extension yii2 security http password username allowedips

18/03 2016

0.1.0

0.1.0.0

Yii2 Http Authentication extension

  Sources   Download

BSD-3-Clause

The Requires

 

by Lajos Molnar

authentication extension yii2 security http password username allowedips

26/04 2015

0.0.2

0.0.2.0

Yii2 Http Authentication extension

  Sources   Download

BSD-3-Clause

The Requires

 

by Lajos Molnar

authentication extension yii2 security http password username allowedips

16/04 2015

0.0.1

0.0.1.0

Yii2 Http Authentication extension

  Sources   Download

BSD-3-Clause

The Requires

 

by Lajos Molnar

authentication extension yii2 security http password username allowedips