Basic Auth
| Block name | Context | Label |
|---|---|---|
basic_auth | Definitions Block | required |
The basic_auth block lets you configure basic auth for your gateway. Like all
access control types, the basic_auth block is defined in the
definitions block and can be referenced in all configuration
blocks by its required label.
If both user/password and htpasswd_file are configured, the incoming
credentials from the Authorization request HTTP header field are checked against
user/password if the user matches, and against the data in the file referenced
by htpasswd_file otherwise.
The user is accessible via request.context.<label>.user variable for successfully authenticated requests.
Attribute htpasswd_file
Couper uses Apache's httpasswd file format. apr1, md5 and bcrypt password encryption are supported. The file is loaded once at startup. Restart Couper after you have changed it.
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
custom_log_fields | object | - | Log fields for custom logging. Inherited by nested blocks. |
htpasswd_file | string | - | The htpasswd file. |
password | string | - | The corresponding password. |
realm | string | - | The realm to be sent in a WWW-Authenticate response HTTP header field. |
user | string | - | The user name. |
Nested Blocks
| Name | Description |
|---|---|
error_handler | Configures an error handler (zero or more). |