定制 lajax/yii2-http-auth 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lajax/yii2-http-auth

最新稳定版本:0.1.0

Composer 安装命令:

composer require lajax/yii2-http-auth

包简介

Yii2 Http Authentication extension

README 文档

README

Latest Version on Packagist Software License Total Downloads

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.

Installation

Via Composer

composer require lajax/yii2-http-auth

Usage

You need to bootstrap the component on the start of the application.

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.

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.

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:

  • 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.

License

The 3-Clause BSD License. Please see License File for more information.

统计信息

  • 总下载量: 3.46k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 3
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2015-04-16