大麦子/http-auth

此包已被放弃,不再维护。未建议替代包。

1.0.1 2017-03-02 10:48 UTC

This package is auto-updated.

Last update: 2020-01-16 15:01:16 UTC


README

此库为您的 Nette 应用程序提供简单的 HTTP 认证。

Build Status Downloads this Month Latest stable Coverage Status

要求

安装

安装 Damejidlo/http-auth 的最佳方式是使用 Composer

$ composer require damejidlo/http-auth

安装后,您需要注册该扩展

extensions:
	httpAuth: Damejidlo\Security\DI\HttpAuthExtension(%consoleMode%) # you need to pass the %consoleMode% parameter (You don't want to require username and password in console)

由于尚未激活,扩展可以在生产环境中安全配置。若需要用户名和密码,应在预发布环境中将它们放入 config.local.neon

httpAuth:
	username: someSecretUsername
	password: SomeSecretPassword

重新部署(或清除缓存)后,您现在应该会通过 HTTP 基本认证提示输入用户名和密码。