Skip to content

Latest commit

 

History

History
60 lines (38 loc) · 2.27 KB

File metadata and controls

60 lines (38 loc) · 2.27 KB
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

Authenticate with Basic

[!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]

Policy statement

<authentication-basic username="username" password="password" />

Attributes

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

Usage

Usage notes

  • 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.

Example

<authentication-basic username="testuser" password="testpassword" />

Related policies

[!INCLUDE api-management-policy-ref-next-steps]