定制 viktor-miller/laravel-basic-auth 二次开发

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

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

viktor-miller/laravel-basic-auth

Composer 安装命令:

composer require viktor-miller/laravel-basic-auth

包简介

laravel basic authentication package

README 文档

README

This package activates the HTTP Basic Authentication mode in the application on Laravel >= 5.4

After you call the command to activate the HTTP Basic Authentication mode, you will be asked to use the default authentication data from the configuration file. These data are permanent. Then you will be asked to use the temporary login data, which will be active only for the current mode. If you enter temporary data, it will be added to the data stack to the existing default login data from the config file (if you selected it). This allows you to have several keys to log in (for example permanent key for the admin and temporary for the customer). If you do not use the authentication data from the configuration file, you will be forced to enter the temporary login data every time. At the end you can enter an optional time interval in days and/or hours and/or minutes, after which the HTTP Basic Authentication mode will be automatically turned off.

Features

  • Artisan commands to turn on/off
  • Configuration file for storing authentication data
  • Support of forced logout. After reactivation, all logged on users will be forced to enter authentication data again.
  • Multilanguage support (EN, DE, RU)
  • Support to set temporary authentication data
  • Support set a time limit (in Days, Hours or Minutes). At the end of this time, the HTTP Basic Authentication mode will be automatically turned off.

console auth

Installation

Add package to your composer.json file:

composer require viktor-miller/laravel-basic-auth

For Laravel >= 5.4 add service provider to config/app.php

'providers' => [
    ViktorMiller\LaravelBasicAuth\ServiceProvider::class,
]

Call artisan command to publish config file

php artisan vendor:publish --tag=basic-auth:config

Change the configuration file basic-auth.php as you like

<?php

return [
    'identities' => [
        [
            env('BASIC_AUTH_USER', 'admin'),
            env('BASIC_AUTH_PASSWORD', 'preview')
        ],
        [
            'admin2',
            'secret'
        ],
    ]
];

Note: in the configuration files, use the passwords as they are, when you turn on the HTTP Basic Authenticationmode, the passwords will be written to the temporary file in storage/framework/basicauth. The passwords will be hashed.

Usage

To put the application into basic HTTP authentication mode, call this command and follow the instructions

php artisan basic-auth:on

To bring the application out of HTTP Basic Authentication mode call

php artisan basic-auth:off

Translation

If you want to add change translation files call

php artisan vendor:publish --tag=basic-auth:translations

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固