| title | Azure API Management policy reference - authentication-basic | Microsoft Docs |
|---|---|
| description | Reference for the authentication-basic policy available for use in Azure API Management. Provides policy usage, settings, and examples. |
| services | api-management |
| author | dlepow |
| ms.service | azure-api-management |
| ms.topic | reference |
| ms.date | 07/23/2024 |
| ms.author | danlep |
[!INCLUDE api-management-availability-all-tiers]
Use the authentication-basic policy to authenticate with a backend service using Basic authentication. This policy effectively sets the HTTP Authorization header to the value corresponding to the credentials provided in the policy.
[!INCLUDE api-management-credentials-caution]
[!INCLUDE api-management-policy-generic-alert]
<authentication-basic username="username" password="password" />| Attribute | Description | Required | Default |
|---|---|---|---|
| username | Specifies the username of the Basic credential. Policy expressions are allowed. | Yes | N/A |
| password | Specifies the password of the Basic credential. Policy expressions are allowed. | Yes | N/A |
- Policy sections: inbound
- Policy scopes: global, workspace, product, API, operation
- Gateways: classic, v2, consumption, self-hosted, workspace
- This policy can only be used once in a policy section.
- We recommend using named values to provide credentials, with secrets protected in a key vault.
<authentication-basic username="testuser" password="testpassword" />[!INCLUDE api-management-policy-ref-next-steps]