We recently migrated the API application from Azure Cloud Services to Azure Websites, and some customers still use our legacy authentication protocol, which uses cookies (instead of the usual Authorization: Bearer HTTP header). We need to support this authentication protocol a little more, as clients will not be able to migrate immediately.
To support cookies in a cross-origin ajax request directed to the API, the client must set the withCredentials parameter to true in XMLHttpRequest, and the server must also respond with the Access-Control-Allow-Credentials header to any CORS request.
The problem we are facing is that the Azure Website independently manages CORS and uses its own configuration (which is limited to the list of allowed sources) to respond, which does not allow setting this header ... thereby violating the application for all our Ajax clients!
Is there a way (temporarily) to add this header to the responses?
source share