Parameters
See plugin common configurations for configuration options available to all plugins.
Credentials
The following are plugin attributes available for configurations on credentials.
username
string
required
Unique basic auth username for a consumer.
password
string
required
Basic auth password for the consumer.
The password is encrypted with AES before being stored in etcd. You can also store it in an environment variable and reference it using the
env://prefix, or in a secret manager such as HashiCorp Vault's KV secrets engine, and reference it using thesecret://prefix. For more information, see secrets.
Routes or Services
The following are plugin attributes available for configurations on routes or services.
hide_credentials
boolean
default:
falseIf true, do not pass the authorization request header to upstream services.
anonymous_consumer
string
Anonymous consumer name. If configured, allow anonymous users to bypass the authentication. See Rate Limit with Anonymous Consumer for more details.
realm
string
default:
basicRealm in the
WWW-Authenticateresponse header returned with a401 Unauthorizedresponse due to authentication failure. For example:If
realmis set tobasic-auth, the 401 response will include the following header:WWW-Authenticate: Basic realm="basic-auth"If
realmis not configured, the 401 response will include the following header:WWW-Authenticate: Basic realm="basic"
This parameter is available in API7 Enterprise version 3.9.2 and later, and in Apache APISIX version 3.15.0 and later.