This library provides simple HTTP authentication for your Nette application.
The best way to install Damejidlo/http-auth is using Composer:
$ composer require damejidlo/http-auth
After install you need to register the extension:
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)
The extension can be configured safely on production environment, because is not activated yet.
For requiring username and password, you should put in
config.local.neon on staging environment:
httpAuth: username: someSecretUsername password: SomeSecretPassword
After redeploy (or clear cache), you should be now prompted for username and password via HTTP basic auth.