How can I set up quota management for API products and configure a quota policy using OAuth 2.0 in Apigee?

67 views Asked by At

I want to achieve the following in Apigee.

  1. Configure quota settings for API products.
  2. Define and apply quota policies that align with OAuth 2.0 authentication in Apigee.
1

There are 1 answers

0
Ron Etch On

To control how many times apps can access your API within a certain timeframe, Apigee lets you implement quota management using a Quota policy and OAuth 2.0. Here's how it works:

Define API Request Limits: Use the Quota policy to set a maximum number of requests allowed for a specific API proxy within a given time period (e.g., per minute, hour, or day).

Customize Quotas with Identifiers: Tailor limits for different apps or users by creating unique counters using flow variables and the <Identifier> element within the Quota policy. This enables you to set different quotas based on criteria like client IDs.

Integrate with OAuth 2.0:

  • Extract the client ID from validated OAuth 2.0 tokens using a JavaScript or Extract Variables policy.

  • Pass this client ID to the Quota policy using a flow variable to link quotas to specific OAuth 2.0 clients.

Reference Default Settings: Streamline configuration by using the <UseQuotaConfigInAPIProduct> element to leverage default quota settings defined in the API product itself.

Implement Dynamic Quotas: Create flexible quota systems based on user segments or other criteria using class-based quotas.

Remember:

  • Apigee Edge tracks quota usage separately for each environment (test, prod, etc.).

  • Thoroughly test quota policies to ensure they function as intended. Consider using

  • Spike Arrest policies to protect against sudden traffic surges.