Created
January 25, 2018 01:53
-
-
Save berndverst/37d87570418bbee77641777e13bc10c9 to your computer and use it in GitHub Desktop.
API Proxy to hide API Credentials based on Azure Functions Proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://json.schemastore.org/proxies", | |
"proxies": { | |
"API proxy with Credentials": { | |
"matchCondition": { | |
"route": "/api/{*route}", | |
"methods": [ | |
"GET" | |
] | |
}, | |
"backendUri": "https://readon.ly/{route}", | |
"requestOverrides": { | |
"backend.request.method": "get", | |
"backend.request.querystring.client_id": "XXXXXXXXX", | |
"backend.request.querystring.client_secret": "ZZZZZZZZZ" | |
} | |
} | |
} | |
} |
This provides a simple way to proxy API requests via your domain to a third party API while keeping your API credentials hidden. This approach is also highly performant and cost effective thanks to the serverless approach.
Simply update the Backend URL with your desired destination API. Update the request params for authentication or add the necessary header override.
Official Documentation: https://docs.microsoft.com/azure/azure-functions/functions-proxies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Or create this via the Azure Portal:
