# ACL Configuration

The `acl` plugin authorizes requests by matching consumer or external user labels against allow and deny policies.<!-- --> <!-- -->Configuration covers plugin parameters.

## Parameters[​](#parameters "Direct link to Parameters")

See plugin [common configurations](https://docs.api7.ai/apisix/reference/plugin-common-configurations.md) for configuration options available to all plugins.

* external\_user\_label\_field

  string

  default: `groups`

  ***

  Field containing the external user's labels. Use a field name for a top-level value or a [JSONPath](https://goessner.net/articles/JsonPath) expression for nested values.

  The selected value can be a list, a serialized JSON array, a delimited string, or a scalar string. Configure `external_user_label_field_parser` when the value requires explicit parsing.

* external\_user\_label\_field\_key

  string

  ***

  Key used to match values selected by a [JSONPath](https://goessner.net/articles/JsonPath) expression against `allow_labels` or `deny_labels`. For example, set this field to `team` when `external_user_label_field` is `$.orgs..team` and the access control list uses the `team` key.

* external\_user\_label\_field\_parser

  string

  valid value:

  `segmented_text`, `json`, or `table`

  ***

  Parser for the selected external-user label value.

  Use `json` for a serialized JSON array, `segmented_text` for a delimited string, or `table` for a list. When omitted, the plugin handles lists, JSON-array strings, comma-separated strings, and scalar strings automatically.

* external\_user\_label\_field\_separator

  string

  ***

  Regular expression used to split labels. Required when `external_user_label_field_parser` is `segmented_text`; unused with the other parsers.

* allow\_labels

  object

  ***

  Labels that allow a request. At least one matching value is required when this field is configured and no value matches `deny_labels`.

  Configure at least one of `allow_labels` and `deny_labels`.

* deny\_labels

  object

  ***

  Labels that deny a request. Any matching value rejects the request before `allow_labels` is evaluated.

  Configure at least one of `allow_labels` and `deny_labels`.

* rejected\_code

  integer

  default: `403`

  valid value:

  greater than or equal to 200

  ***

  HTTP status code to return when the request is rejected.

* rejected\_msg

  string

  default: `The consumer is forbidden.`

  ***

  Error message to return when the request is rejected. When omitted, the plugin returns `The consumer is forbidden.`
