Outbound OAuth2 rule
- The Outbound OAuth2 rule isn't available for Triggered Task or Ultra Task endpoints.
- The accounts used in the rule automatically reflect the changes made in the OAuth2 account itself.
- If you delete an account, the rule that references it becomes invalid and displays an error until you select another account.
Prerequisites
An OAuth2 account in the global shared project. For an account type that has an Authorize button, authorize the account before you use it. To create one, refer to Create an account in the Policy builder.
Supported Account Types
The rule accepts the following account types:
- API Suite OAuth2 Account
- REST OAuth2 Account
- REST Dynamic OAuth2 Account
- Microsoft Entra ID OAuth2 Account
- SSL OAuth2 Account, which you can create only in Project Manager
Rule Execution Order
The Outbound OAuth2 rule executes after all rules, when the proxy calls the upstream API.
| Field/Field set | Description |
|---|---|
| When this rule should be applied | An expression that defines one or more conditions that must be
true for the rule to execute.
Example: The expression |
| 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 theAuthorization header:
Default value: Bearer |
| 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.Example: |
| Query String Parameter Name | Appears when Token Location is Query. Enter the name of the query string parameter that holds the token.Example: |
| Status | Select to enable the rule. Default status: Selected |
| Account Reference | Select an OAuth2 account in the global shared project. For the
steps, refer to Associate an account with an outbound rule. Default value: N/A Example: ../../shared/OutboundPolicyRestOAuth2 |
| Description |
Required. A brief description of this rule. Default value: Outbound requests are being authenticated using specified OAuth2 service Example: Dev Env Outbound OAuth |