An Azure service that provides a hybrid, multi-cloud management platform for APIs.
Hi @J, Munna Lal,
We sincerely apologize for the delay in response and appreciate your patience.
It looks like you're facing an issue with the CORS inbound policy in API Management, where requests from other URLs are still being accepted despite your configuration to allow only specific domains. Here’s a straightforward approach to help you resolve this:
- First, double-check your CORS settings in API Management. Make sure the policy is applied at the correct level—either at the API level or the operation level.
- Ensure that your CORS policy is set up correctly. Here’s an example of how to configure it in Azure API Management: <inbound>
</inbound><cors> <allowed-origins> <origin>https://companyabcproducts.atlassian.net</origin> </allowed-origins> <allowed-methods> <method>GET</method> <method>POST</method> <method>OPTIONS</method> </allowed-methods> <allowed-headers> <header>*</header> </allowed-headers> </cors> - Sometimes, browser caching can interfere with CORS behavior. Try clearing your browser cache or testing in an incognito window to ensure that the latest CORS settings are being applied.
- Review any other policies that might be affecting request handling, such as authentication or IP filtering. Make sure there are no conflicting policies that could allow unwanted requests.
- Use tools like Postman or your browser's developer tools to test CORS requests. Check the response headers to confirm that the
Access-Control-Allow-Originheader is set correctly and only allows the specified origin.
For more detailed guidance on configuring CORS in Azure API Management, please refer to the official documentation here:
https://learn.microsoft.com/en-us/azure/api-management/api-management-policies
By following these steps, you should be able to effectively manage your CORS policy and ensure that only the specified domain can make requests. If you continue to experience issues, please let me know, and we can explore further options together.