Authenticate with Basic
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.
Set the policy's elements and child elements in the order provided in the policy statement. Learn more about how to set or edit API Management policies.
<authentication-basic username="username" password="password" />
|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: dedicated, consumption, self-hosted
- 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" />
For more information about working with policies, see: