Azure / Azure/api-management-policy-snippets
REQUEST: Snippet to Continue Inbound and Backend Processing Without Returning a Response When validate-jwt Fails
- Dominant language
- No language data
- Stars
- 399
- Forks
- 170
- PR merge metrics
- No merged PRs in 30d
Description
I am interested in a way to continue processing even if the validation using validate-jwt or validate-azure-ad-token fails. A similar issue has been discussed on Stack Overflow. However, with that approach, after the on-error processing, a response configured with failed-validation-httpcode is returned, making it impossible to continue inbound processing.
https://stackoverflow.com/questions/79085220/azure-apim-dont-return-error-if-token-validation-fails
The use case for this scenario is to provide APIs categorized by a certain service level. While I use validate-azure-ad-token to protect the API, I aim to offer a freemium API product that allows free-tier users limited usage with policies like quota and rate-limiting, even if they fail authorization. However, I’m struggling to find a way to continue processing when validation fails and have been unable to implement this.
I would appreciate it if you could provide a sample implementation.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the linked Stack Overflow discussion and the behavior of validate-jwt and validate-azure-ad-token in Azure API Management. A complete result should provide a sample policy that continues inbound and backend processing after validation fails, without returning the failed-validation-httpcode response, while still supporting quota and rate-limiting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- api, cloud
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100