I'm trying to write a JavaScript client for Visual Studio Team Services REST API which send AJAX requests to our self hosted Team Foundation Server 2015 but I'm facing to a cross domain issue.
The API requires credentials to authenticate but due to security reasons, the browser blocks my requests because the parameter Access-Control-Allow-Origin
is set with the wildcard *
.
I tried to add this parameter in HTTP Response Headers in IIS Manager and also in the TFS web.config file (which is actually the same) but I got an error telling me that this parameter has two different value (eg: *
and http://localhost:58785
) and should have only one.
I guess this value is already defined in libraries's code which I can't access because the TFS web service is already compiled and running on IIS.
I also tried to use the markup <location allowOverride="false">
in web.config, to forbid configuration override but in that case TFS won't start.
Somebody already asked about this issue here and also posted a ticket on uservoice but as the name of the API is really ambiguous (Visual Studio Online REST API), I don't know if this guy talks about the real Visual Studio online or if his case is the same as mine (self hosted TFS Server).
We already implemented some features in C# which are working well but now we really need to implement a JavaScript client. Writing a web service and use it as a proxy to query the API is for us a real mess and we don't want to do this.
This is so sad we can't send AJAX requests to the API because of a configuration we aren't able to change.