Azure APIM- cache-lookup-value failed to validate on POST Request

Smithesh Purushothaman 1 Reputation point
2022-02-11T00:05:41.86+00:00

Below is the policy configured at the API level but it failed to validate cache-lookup-value key
<cors>
<allowed-origins>
<origin></origin>
</allowed-origins>
<allowed-methods>
<method>GET</method>
<method>POST</method>
</allowed-methods>
<allowed-headers>
<header>
</header>
</allowed-headers>
</cors>
<!-- base: End Product scope -->
<!-- Extract Token from Authorization header parameter -->
<set-variable name="token" value="@(context.Request.Url.Query.GetValueOrDefault("accesstoken"))" />
<!-- Check for cached authorization status for the subject -->
<cache-lookup-value key="@((string)context.Variables["token"])" variable-name="ClinicID" />

173343-image.png

Please share your thoughts. The request type is POST, same policy work with GET request with no issues

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,797 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Smithesh Purushothaman 1 Reputation point
    2022-02-11T01:14:54.513+00:00

    Seems like APIM is not identifying the methods for some reason. I was trying the execute GET call from inbound policy, but its not getting through
    173352-image.png

    173297-image.png

    0 comments No comments

  2. Smithesh Purushothaman 1 Reputation point
    2022-02-11T01:35:48.65+00:00

    Guys,
    Is it because, my inbound request has both GET and POST.
    Another GET endpoint work like a charm

    0 comments No comments