I currently have an Exchange 2019 on-premise server setup to test my OWA add-in. I'm calling the api/v2.0/me/messages/{id}
endpoint from my add-in. Everything works just fine with hitting the cloud (Office 365), but against the on-prem Exchange I get a 405 Method Not Allowed
back for the CORS preflight OPTIONS header request.
I have tried the fixes recommended by - IIS hijacks CORS Preflight OPTIONS request, Handling CORS Preflight requests to ASP.NET MVC actions, and https://blogs.iis.net/iisteam/getting-started-with-the-iis-cors-module
The response from the server for the CORS request contains the following as I'd expect -
access-control-allow-origin: *
access-control-allow-headers: Origin, Authorization, X-Requested-With, Content-Type, Accept
access-control-allow-methods: GET, POST, PUT, DELETE, OPTIONS
Is there something IIS or Exchange specific needed to enable CORS for this scenario?