Add basic authentication (#1683)
* Add basic authentication Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
This commit is contained in:
parent
b42819b69d
commit
202ecf9c9d
37 changed files with 5132 additions and 52 deletions
|
|
@ -25,4 +25,27 @@ tls_config:
|
|||
|
||||
# CA certificate for client certificate authentication to the server
|
||||
[ client_ca_file: <filename> ]
|
||||
|
||||
# List of usernames and hashed passwords that have full access to the web
|
||||
# server via basic authentication. If empty, no basic authentication is
|
||||
# required. Passwords are hashed with bcrypt.
|
||||
basic_auth_users:
|
||||
[ <username>: <password> ... ]
|
||||
```
|
||||
|
||||
## About bcrypt
|
||||
|
||||
There are several tools out there to generate bcrypt passwords, e.g.
|
||||
[htpasswd](https://httpd.apache.org/docs/2.4/programs/htpasswd.html):
|
||||
|
||||
`htpasswd -nBC 10 "" | tr -d ':\n`
|
||||
|
||||
That command will prompt you for a password and output the hashed password,
|
||||
which will look something like:
|
||||
`$2y$10$X0h1gDsPszWURQaxFh.zoubFi6DXncSjhoQNJgRrnGs7EsimhC7zG`
|
||||
|
||||
The cost (10 in the example) influences the time it takes for computing the
|
||||
hash. A higher cost will en up slowing down the authentication process.
|
||||
Depending on the machine, a cost of 10 will take about ~70ms where a cost of
|
||||
18 can take up to a few seconds. That hash will be computed on every
|
||||
password-protected request.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue