title | description | services | author | ms.service | ms.topic | ms.date | ms.author |
---|---|---|---|---|---|---|---|
Azure API Management policy reference - authentication-basic | Microsoft Docs | Reference for the authentication-basic policy available for use in Azure API Management. Provides policy usage, settings, and examples. | api-management | dlepow | azure-api-management | reference | 07/23/2024 | 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-basicusername="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-basicusername="testuser"password="testpassword" />
[!INCLUDE api-management-policy-ref-next-steps]