Demo API to demonstrate caching of OAuth Token received from External API and use it for subsequent calls.
API Flow
Client --> Apigee API secured by OAuth (CacheDemoApi) --> External API secured by OAuth (ExternalApi)
Dependent APIs
- 2-Legged-OAuth - API to get OAuth token for CacheDemoAPI.
- ExternalOAuthApi - Demo OAuth API for external OAuth.
- ExternalApi - Dmeo API for external API secured with OAuth.
Flow for Apigee API Caching.
- LookupCache policy is used to look for access token before calling external OAuth API.
- If cache returns null, call to external OAuth API is made.
- Access token from above step in response is cached using PopulateCache policy.
- If cache returns value, same is used and call to External OAuth API is skipped.
Note: Cache expiration time must be set less than token exipres_in value.