Skip to content
Branch: master
Find file History
wsilveiranz and tomkerkhove Aligning cache duration to token duration (#38)
* Update Backend OAuth2 Authentication With Cache.policy.xml

Remove token cache duration name value parameter and derive the value from the token received from token provider. Token duration and cache duration are now linked.

* Update Backend OAuth2 Authentication With Cache.policy.xml

Fixing typo.

* Update Backend OAuth2 Authentication With Cache.policy.xml

Strong typing tokenDurationSeconds

* Moved body result to variable.

Seems like the body result is in a stream so you can only read it once (after that you will probably be at the end of the stream). So trying to read twice for access_token and expires_in generated an error (not found on the second read). Moving the Body to a JObject variable solved the issue.
Latest commit dfc9c20 Oct 28, 2019
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
Add correlation id to inbound request.policy.xml Adding VS Code snippets file Jun 19, 2018
Authenticate using Managed Identity to access Service Bus.xml correct description Sep 24, 2019
Authorize requests using external authorizer.policy.xml Adding VS Code snippets file Jun 19, 2018
Back-end API redundancy.policy.xml Add 'Back-end API redundancy' policy Oct 23, 2018
Backend OAuth2 Authentication With Cache.policy.xml Aligning cache duration to token duration (#38) Oct 28, 2019
Call out to an HTTP endpoint and cache the response.policy.xml Adding VS Code snippets file Jun 19, 2018
Encrypt data using expressions.policy.xml added snippet for encryption Apr 11, 2019
Filter response content based on product name.policy.xml moving from code comment to xml compliant comment Oct 2, 2019
Forward Azure Event Grid Event.xml Improve docs in policies + add myself as maintainer Jan 23, 2019
Forward gateway hostname to backend for generating correct urls in responses.policy.xml Adding VS Code snippets file Jun 19, 2018
Generate Azure Relay Token.policy.xml Update Generate Azure Relay Token.policy.xml Oct 16, 2018
Generate Shared Access Signature and forward request to Azure storage.policy.xml Fixed a bug Jul 3, 2019
Get OAuth2 access token from AAD and forward it to the backend.policy.xml Guidance for identity providers other than AAD Mar 14, 2019
Get X-CSRF token from SAP gateway using send request.policy.xml Add all files in overview + align naming convention Jun 23, 2018
Log errors to Stackify.policy.xml Add all files in overview + align naming convention Jun 23, 2018
Look up Key Vault secret using Managed Service Identity.policy.xml Extend note Apr 28, 2019
Mask async calls as synchronous.policy.xml Adding VS Code snippets file Jun 19, 2018
Parse a JWT token using expressions.xml Updated based on feedback Apr 4, 2019
Perform basic authentication.policy.xml Adding VS Code snippets file Jun 19, 2018
Pre-authorize requests based on HTTP method with validate-jwt.policy.xml Adding VS Code snippets file Jun 19, 2018
Query CosmosDB.policy.xml Adding VS Code snippets file Jun 19, 2018
README.md Add service bus example to readme Sep 24, 2019
Random load balancer.policy.xml Adding VS Code snippets file Jun 19, 2018
Route requests based on size.policy.xml Adding VS Code snippets file Jun 19, 2018
Route requests to regional backend instances.xml Minor refctoring of the new routing policy Aug 13, 2018
Send request context information to the backend service.policy.xml Adding VS Code snippets file Jun 19, 2018
Set cache duration using response cache control header.policy.xml Adding VS Code snippets file Jun 19, 2018
Simple Google OAuth validate-jwt.policy.xml Updated typo (Azure docs #11453) Jul 9, 2018
Trigger Azure Data Factory Pipeline With Parameters.policy.xml Improve docs in policies + add myself as maintainer Jan 23, 2019
Trigger Azure Data Factory Pipeline.policy.xml Improve docs in policies + add myself as maintainer Jan 23, 2019

README.md

Overview

Policy Name What does it do?
Add correlation id to inbound request Add Correlation Id for inbound requests
Authenticate using Managed Identity to access Service Bus Authenticate using Managed Identity to access Service Bus and send a message to a queue/topic
Authorize requests using external authorizer Secure API access by using an external authorizer encapsulating custom authentication/authorization logic
Back-end API redundancy Routes calls to the closest of two backend services, and fails over to the secondary if an HTTP 404 is returned.
Call out to an HTTP endpoint and cache the response Enrich requests by calling HTTP endpoint before calling a backend service
Filter response content based on product name Filter data elements from the response payload based on the product associated with the request
Forward gateway hostname to backend for generating correct urls in responses Add a Forwarded header in the inbound request to allow the backend API to construct proper URLs
Forward Azure Event Grid Event Forwards an Azure Event Grid event data payload to a downstream system and adds the event metadata to the HTTP headers.
Generate Azure Relay Token Provide the capability to generate and caches an Azure Relay Token to securely connect to Azure Relay, abstracting the generation of a relay token from the clients. The policy also provide placeholders to convert requests from JSON to XML, and to convert responses from XML to JSON.
Generate Shared Access Signature and forward request to Azure storage Generate Shared Access Signature and forward request to Azure Storage
Get OAuth2 access token from AAD and forward it to the backend OAuth2 for authorization between the gateway and a backend
Get X-CSRF token from SAP gateway using send request Implement X-CSRF pattern, in this case SAP
Log errors to Stackify Error logging policy to send errors to Stackify
Mask async calls as synchronous Mask an asynchronous API endpoint as if it is an synchronous one
Perform basic authentication Perform basic authentication in the inbound request
Pre-authorize requests based on HTTP method with validate-jwt Authorize access to specific HTTP methods on an API based on JWT claims
Query CosmosDB Query CosmosDB
Random load balancer Randomly routes (load balances) to one of the two backends
Route requests based on size Route requests based on the size of the message body
Route requests based on the region Route requests to regional backend service deployments based on the Azure API Management instance's region they reached
Send request context information to the backend service Sends context information to the backend service for logging or processing
Set cache duration using response cache control header Sets response cache duration using maxAge value in Cache-Control header sent by the backend
Simple Google OAuth validate-jwt Authorize access to your endpoints using Google as an OAuth token provider
Triggering an Azure Data Factory Pipeline Provide the capability to trigger a specific Azure Data Factory Pipeline without parameters. The authentication handshake with Azure Management REST API is handled in the policy itself so that consumers do not need to manage this
Trigger Azure Data Factory Pipeline With Parameters Provide the capability to trigger a specific Azure Data Factory Pipeline with parameters. The authentication handshake with Azure Management REST API is handled in the policy itself so that consumers do not need to manage this
Parse a JWT token using expressions Use policy expressions to parse a JWT token and conditionally execute policies based on values in a claim
Encrypt data using expressions Use policy expressions to encrypt a parameter using AES algorithm
Look up Key Vault secret using Managed Service Identity Look up and use a Key Vault secret using Managed Service Identity
You can’t perform that action at this time.