INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: MCWS Authentication from JavaScript Issue (No 'Access-Control-Allow-Origin')  (Read 4567 times)

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14265
  • I won! I won!

I'm getting errors trying to authenticate MCWS calls using Javascript (in an HTML page) from Chrome namely - No 'Access-Control-Allow-Origin' header is present on the requested resource

Code: [Select]
function MCWS(str) {
  var xmlhttp = new XMLHttpRequest();
  xmlhttp.open("GET", str, false, username, password);
  xmlhttp.send();
  document.getElementById("demo").innerHTML = xmlhttp.responseText;
}

I've tried several variations of the GET including:
   xmlhttp.open("GET", "http://"+username+":"+password+"@"+str, false);
   xmlhttp.setRequestHeader("Authorization", "Basic " + btoa(username + ":" + password))

The script is on the same PC and the MCWS.

Any ideas?
Thanks
Nathan
Logged
JRiver CEO Elect

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10710

We do supply Access-Control-Allow-Origin headers, though.
Logged
~ nevcairiel
~ Author of LAV Filters

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10710

The next build should extend CORS support for MCWS, which might help to support better JavaScript usage.
Its been on my list forever to extend this.
Logged
~ nevcairiel
~ Author of LAV Filters

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14265
  • I won! I won!

Thanks - I'll have a play on the Weekend!
Logged
JRiver CEO Elect
Pages: [1]   Go Up