Outbound Basic Auth Policy

Important: This page describes Classic APIM. For APIM 3.0, refer to API Management 3.0.
Adds the username and password from an API Suite Basic Auth Account, encoded as a Base64 token, to each request that the proxy sends to the upstream API. The policy sets where the request carries the token: in a header, in the request body, or in a query string parameter.
Note:
  • The Outbound Basic Auth policy isn't available for Triggered Task or Ultra Task endpoints.
  • The accounts used in the policy automatically reflect the changes made in the account itself.
  • If you delete an account, the policy that references it becomes invalid and displays an error until you select another account.

Prerequisites

An API Suite Basic Auth Account in the global shared project. To create one, refer to Create accounts.

Supported account types

The policy accepts only the Basic Authentication Account.

Policy execution order

The Outbound Basic Auth policy executes after all policies, when the proxy calls the upstream API.

Known Issues

When you use the HTTP Retry Policy with the Basic Auth policy, the request fails with an error message. This issue applies only to Proxies created after the February 2024 release. Existing Proxies are unaffected.

Workaround: Delete the HTTP Retry Policy.

Field Name Description
When this policy should be applied An expression that defines one or more conditions that must be true for the policy to execute.

Example: The expression request.method == "POST" causes the policy to execute only on POST requests.

Token Location Required. Select where the request carries the token: Header, Body, or Query.

Default value: Header

Authorization Scheme

Appears when Token Location is Header.

Select the scheme that precedes the token in the Authorization header:
  • Basic: The header value is Basic <token>.
  • Custom: The header value starts with the scheme that you enter in Custom Authorization Scheme.

Default value: Basic

Custom Authorization Scheme

Appears when Authorization Scheme is Custom.

Enter the scheme to send before the token.
Request Body Key

Appears when Token Location is Body.

Enter the JSON key that holds the token in the request body.
Query String Parameter Name

Appears when Token Location is Query.

Enter the name of the query string parameter that holds the token.
Account Reference Select an API Suite Basic Auth Account in the global shared project.
Description

Default value: Outbound requests are being authenticated with Basic Auth