Hi,
I've a Asp.Net Web Api rest service connected to Azure ServiceBus.
I'm making ajax calls to this service. So I need an access Token to be passed as a header i.e. "Authorization : WRAP access_token=<my_token>" with the call.
This works fine when I make a direct GET request using Postman or RestClient. But when I make an ajax call from my website the browser makes it a pre-flight request. The Authorization header passed to this call is passed in another header called access-control-request-headers. Hence the service bus doesn't receives any header named Authorization and returns 401-Not Authorized error without even hitting the api service.
I need suggestions on how to either dodge the request from getting pre-flighted or pass the Authorization header as a direct header in pre-flight request.