With an API gateway integration, you can target API services, operations, inbound requests, and outbound responses in custom rules and policies.
Switch to using custom rules in any operations you want to target in your policy.
-
Copy the ID for the API service or custom operation that you want to target in
your policy:
- Go to Authorize > API Services.
-
Do one of the following:
- Click the API service you want to target. On the
Overview tab, copy the
ID.
- Click the API service that includes the custom operation that you want to target, then
click the Operations tab. Expand the
operation and copy the ID.
- Click the API service you want to target. On the
Overview tab, copy the
ID.
- Go to Authorize > Policies, and click a policy or add a new policy.
-
To target an API service or a custom operation in the policy:
- In Applies When, click + Comparison.
-
In the Select an attribute list, select one of
the following:
- To target an API service, select PingOne > API Access Management > API Server > ID.Note:
If you target an API service without targeting individual operations, the policy targets all custom operations under the API service.
- To target a custom operation, select PingOne > API Access Management > Operation > ID.Note:
You can target more than one operation. If you don’t target an API service or any operations, the policy targets all custom operations.
- To target an API service, select PingOne > API Access Management > API Server > ID.
- Select the Equals comparator.
-
In the C (constant) field, enter the
ID that you copied in step 1b.
The following image shows a comparison that targets a custom operation.
-
To target an inbound request or outbound response:
- In Applies When, click + Comparison.
- In the Select an attribute list, select PingOne > API Access Management > Phase.
- Select the Equals comparator.
-
In the C (constant) field, enter
INBOUND_REQUEST or
OUTBOUND_RESPONSE.
The following image shows comparisons that target a custom operation and the outbound response.
Note:If you don’t target a request or response specifically, the policy targets both the request and response.
-
If you added more than one comparison, select one of the following
options:
- All: Applies the policy when all of the conditions are true. This is like adding an AND boolean operator between comparisons.
- Any: Applies the policy when one of the conditions is true. This is like adding an OR boolean operator between comparisons.
- None: Applies the policy when none of the conditions are true. This is like adding a NOT boolean operator.
- Click Save changes.