2

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?

Bean
  • 61
  • 5
  • make sure you install the iis cors module. remove the unused Handlers. and try to add the Add OPTIONS Handler. try to follow this link detailed steps: https://stackoverflow.com/questions/15584909/cors-405-method-not-allowed – Jalpa Panchal Feb 25 '20 at 02:11
  • 1
    I have done all of those steps. It looks like the OWA REST API isn't supported on-premise at this time - https://github.com/OfficeDev/office-js/issues/991#issuecomment-590652863 – Bean Feb 25 '20 at 08:42

0 Answers0